SimStateEventSource.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef _SIMSTATE_EVENTSOURCE_HH_
19 #define _SIMSTATE_EVENTSOURCE_HH_
20 
21 #include "EventSource.hh"
22 
23 
24 namespace gazebo
25 {
28  {
33  physics::WorldPtr _world);
34 
36  public: virtual ~SimStateEventSource();
37 
40  public: virtual void Load(const sdf::ElementPtr _sdf);
41 
44  public: virtual void OnUpdate(const common::UpdateInfo &_info);
45 
48  public: void OnPause(bool _p);
49 
51  private: bool hasPaused;
52 
54  private: event::ConnectionPtr pauseConnection;
55 
57  private: event::ConnectionPtr updateConnection;
58 
60  private: common::Time simTime;
61  };
62 }
63 
64 #endif
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:84
void OnPause(bool _p)
Callback for the pause event.
Forward declarations for the common classes.
Definition: Animation.hh:33
virtual ~SimStateEventSource()
Dtor.
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
SimStateEventSource(transport::PublisherPtr _pub, physics::WorldPtr _world)
Constructor.
Information for use in an update event.
Definition: UpdateInfo.hh:30
virtual void OnUpdate(const common::UpdateInfo &_info)
Update for every time step.
virtual void Load(const sdf::ElementPtr _sdf)
Load the name of the event from the world file.
The base class for emitting SimEvents.
Definition: EventSource.hh:39
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
SimEvent that fires when the simulation is paused/resumed.
Definition: SimStateEventSource.hh:27
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44