InRegionEventSource Class Reference

The event generator class. More...

#include <InRegionEventSource.hh>

Inherits EventSource.

Public Member Functions

 InRegionEventSource (transport::PublisherPtr _pub, physics::WorldPtr _world, const std::map< std::string, RegionPtr > &_regions)
 Constructor. More...
 
void Emit (const std::string &_data) const
 emit an event with data to the internal publisher (and using the internal type) More...
 
void Info () const
 Prints data about the event source to the log (useful for debug) 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)
 Loads the full name of the model and the region from the world file. More...
 
void Update ()
 Called every simulation 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...
 

Detailed Description

The event generator class.

Constructor & Destructor Documentation

InRegionEventSource ( transport::PublisherPtr  _pub,
physics::WorldPtr  _world,
const std::map< std::string, RegionPtr > &  _regions 
)

Constructor.

Parameters
[in]_pubthe publisher for the SimEvents
[in]_worldPointer to the world.
[in]_regionsdictionary of regions in the world

Member Function Documentation

void Emit ( const std::string &  _data) const
inherited

emit an event with data to the internal publisher (and using the internal type)

Parameters
[in]_datathe JSON data related to this event.
void Info ( ) const

Prints data about the event source to the log (useful for debug)

virtual void Init ( )
virtual

Initialize the event.

Reimplemented from EventSource.

virtual bool IsActive ( ) const
virtualinherited

An event source can be used to enable other events.

Inactive events do not generate an message when Emit is called.

Returns
true if the event is active
virtual void Load ( const sdf::ElementPtr  _sdf)
virtual

Loads the full name of the model and the region from the world file.

Parameters
[in]_sdf

Reimplemented from EventSource.

void Update ( )

Called every simulation step.

Member Data Documentation

bool active
protectedinherited

True if the event source is active.

Inactive event sources do not emit events

std::string name
protectedinherited

Name of the event.

transport::PublisherPtr pub
protectedinherited

a way to send messages to the other topics (to the REST)

std::string type
protectedinherited

Type of event.

physics::WorldPtr world
protectedinherited

Pointer to the world.


The documentation for this class was generated from the following file: