The base class for emitting SimEvents. More...
#include <EventSource.hh>
Inherited by ExistenceEventSource, InRegionEventSource, JointEventSource, OccupiedEventSource, and SimStateEventSource.
Public Member Functions | |
| EventSource (transport::PublisherPtr _pub, const std::string &_type, physics::WorldPtr _world) | |
| Constructor.  More... | |
| virtual | ~EventSource () | 
| Destructor.  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 from an sdf element (with possible configuration data)  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... | |
The base class for emitting SimEvents.
| EventSource | ( | transport::PublisherPtr | _pub, | 
| const std::string & | _type, | ||
| physics::WorldPtr | _world | ||
| ) | 
Constructor.
| [in] | _pub | the publisher where the events are emitted | 
| [in] | _type | the type of event | 
| [in] | _world | Pointer to the world (in order to get model refs, etc) | 
      
  | 
  virtual | 
Destructor.
| void Emit | ( | const std::string & | _data | ) | const | 
emit an event with data to the internal publisher (and using the internal type)
| [in] | _data | the JSON data related to this event. | 
      
  | 
  virtual | 
Initialize the event.
Reimplemented in JointEventSource, and InRegionEventSource.
      
  | 
  virtual | 
An event source can be used to enable other events.
Inactive events do not generate an message when Emit is called.
      
  | 
  virtual | 
Load from an sdf element (with possible configuration data)
| [in] | _sdf | the sdf element for the event in the world file | 
Reimplemented in JointEventSource, OccupiedEventSource, InRegionEventSource, SimStateEventSource, and ExistenceEventSource.
      
  | 
  protected | 
True if the event source is active.
Inactive event sources do not emit events
      
  | 
  protected | 
Name of the event.
      
  | 
  protected | 
a way to send messages to the other topics (to the REST)
      
  | 
  protected | 
Type of event.
      
  | 
  protected | 
Pointer to the world.