18 #ifndef _GAZEBO_PLUGIN_EVENTSOURCE_HH_
19 #define _GAZEBO_PLUGIN_EVENTSOURCE_HH_
30 #include "gazebo/physics/physics.hh"
31 #include "gazebo/common/common.hh"
46 const std::string &_type,
55 public:
void Emit(
const std::string& _data)
const;
59 public:
virtual void Load(
const sdf::ElementPtr _sdf);
62 public:
virtual void Init();
67 public:
virtual bool IsActive()
const;
70 protected: std::string
name;
73 protected: std::string
type;
94 public:
template<
typename T>
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:153
virtual void Disconnect(ConnectionPtr _c)
Disconnect a callback to this event.
Definition: Event.hh:633
void Emit(const std::string &_data) const
emit an event with data to the internal publisher (and using the internal type)
Forward declarations for transport.
boost::shared_ptr< EventSource > EventSourcePtr
Definition: EventSource.hh:86
virtual bool IsActive() const
An event source can be used to enable other events.
virtual void Load(const sdf::ElementPtr _sdf)
Load from an sdf element (with possible configuration data)
virtual ~EventSource()
Destructor.
static event::ConnectionPtr ConnectSpawnModel(T _subscriber)
Connect a boost::slot to the spawn model event.
Definition: EventSource.hh:96
static void DisconnectSpawnModel(event::ConnectionPtr _subscriber)
Disconnect a boost::slot to the spawn model event.
Definition: EventSource.hh:101
Gazebo events to detect model creation/deletion.
Definition: EventSource.hh:89
ConnectionPtr Connect(const boost::function< T > &_subscriber)
Connect a callback to this event.
Definition: Event.hh:617
std::string type
Type of event.
Definition: EventSource.hh:73
The base class for emitting SimEvents.
Definition: EventSource.hh:39
virtual void Init()
Initialize the event.
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:84
EventSource(transport::PublisherPtr _pub, const std::string &_type, physics::WorldPtr _world)
Constructor.
static event::EventT< void(std::string, bool)> spawnModel
A model has been completed and uploaded onto the server.
Definition: EventSource.hh:106
physics::WorldPtr world
Pointer to the world.
Definition: EventSource.hh:76
bool active
True if the event source is active.
Definition: EventSource.hh:80
std::string name
Name of the event.
Definition: EventSource.hh:70
transport::PublisherPtr pub
a way to send messages to the other topics (to the REST)
Definition: EventSource.hh:83
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49