SimEvent that fires when the simulation is paused/resumed. More...
#include <SimStateEventSource.hh>
Inherits EventSource.
Public Member Functions | |
SimStateEventSource (transport::PublisherPtr _pub, physics::WorldPtr _world) | |
Constructor. More... | |
virtual | ~SimStateEventSource () |
Dtor. More... | |
void | Emit (const std::string &_data) const |
emit an event with data to the internal publisher (and using the internal type) More... | |
virtual void | Init () |
Initialize the event. More... | |
virtual bool | IsActive () const |
An event source can be used to enable other events. More... | |
virtual void | Load (const sdf::ElementPtr _sdf) |
Load the name of the event from the world file. More... | |
void | OnPause (bool _p) |
Callback for the pause event. More... | |
virtual void | OnUpdate (const common::UpdateInfo &_info) |
Update for every time step. More... | |
Protected Attributes | |
bool | active |
True if the event source is active. More... | |
std::string | name |
Name of the event. More... | |
transport::PublisherPtr | pub |
a way to send messages to the other topics (to the REST) More... | |
std::string | type |
Type of event. More... | |
physics::WorldPtr | world |
Pointer to the world. More... | |
SimEvent that fires when the simulation is paused/resumed.
SimStateEventSource | ( | transport::PublisherPtr | _pub, |
physics::WorldPtr | _world | ||
) |
Constructor.
[in] | _pub | publisher for the SimEvents |
[in] | _world | pointer to the world. |
|
virtual |
Dtor.
|
inherited |
emit an event with data to the internal publisher (and using the internal type)
[in] | _data | the JSON data related to this event. |
|
virtualinherited |
Initialize the event.
Reimplemented in JointEventSource, and InRegionEventSource.
|
virtualinherited |
An event source can be used to enable other events.
Inactive events do not generate an message when Emit is called.
|
virtual |
Load the name of the event from the world file.
[in] | _sdf | the event element in the world file |
Reimplemented from EventSource.
void OnPause | ( | bool | _p | ) |
Callback for the pause event.
[in] | _p | true if the sim has been paused |
|
virtual |
Update for every time step.
[in] | _info | Update information provided by the server. |
|
protectedinherited |
True if the event source is active.
Inactive event sources do not emit events
|
protectedinherited |
Name of the event.
|
protectedinherited |
a way to send messages to the other topics (to the REST)
|
protectedinherited |
Type of event.
|
protectedinherited |
Pointer to the world.