##

Events.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _EVENTS_HH_
#define _EVENTS_HH_
#include <string>
#include <sdf/sdf.hh>
#include "gazebo/common/Console.hh"
#include "gazebo/common/UpdateInfo.hh"
#include "gazebo/common/Event.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace event
{
class GZ_COMMON_VISIBLE Events
{
public: template<typename T>
static ConnectionPtr ConnectPause(T _subscriber)
{ return pause.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectStep(T _subscriber)
{ return step.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectStop(T _subscriber)
{ return stop.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectWorldCreated(T _subscriber)
{ return worldCreated.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectCreateEntity(T _subscriber)
{ return entityCreated.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectSetSelectedEntity(T _subscriber)
{ return setSelectedEntity.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectDeleteEntity(T _subscriber)
{ return deleteEntity.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectAddEntity(T _subscriber)
{ return addEntity.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectWorldUpdateBegin(T _subscriber)
{ return worldUpdateBegin.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectBeforePhysicsUpdate(T _subscriber)
{ return beforePhysicsUpdate.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectWorldUpdateEnd(T _subscriber)
{ return worldUpdateEnd.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectWorldReset(T _subscriber)
{ return worldReset.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectTimeReset(T _subscriber)
{ return timeReset.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectRemoveSensor(T _subscriber)
{ return removeSensor.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectCreateSensor(T _subscriber)
{ return createSensor.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectPreRender(T _subscriber)
{ return preRender.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectRender(T _subscriber)
{ return render.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectPostRender(T _subscriber)
{ return postRender.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectDiagTimerStart(T _subscriber)
{ return diagTimerStart.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectDiagTimerStop(T _subscriber)
{ return diagTimerStop.Connect(_subscriber); }
public: template<typename T>
static ConnectionPtr ConnectSigInt(T _subscriber)
{ return sigInt.Connect(_subscriber); }
public: static EventT<void (bool)> pause;
public: static EventT<void ()> step;
public: static EventT<void ()> stop;
public: static EventT<void ()> sigInt;
public: static EventT<void (std::string)> worldCreated;
public: static EventT<void (std::string)> entityCreated;
public: static EventT<void (std::string, std::string)> setSelectedEntity;
public: static EventT<void (std::string)> addEntity;
public: static EventT<void (std::string)> deleteEntity;
public: static EventT<void (const common::UpdateInfo &)> worldUpdateBegin;
public: static EventT<void (const common::UpdateInfo &)>
beforePhysicsUpdate;
public: static EventT<void ()> worldUpdateEnd;
public: static EventT<void ()> worldReset;
public: static EventT<void ()> timeReset;
public: static EventT<void ()> preRender;
public: static EventT<void ()> render;
public: static EventT<void ()> postRender;
public: static EventT<void (std::string)> diagTimerStart;
public: static EventT<void (std::string)> diagTimerStop;
public: static EventT<void (std::string)> removeSensor;
public: static EventT<void (sdf::ElementPtr,
const std::string &,
const std::string &,
const uint32_t)> createSensor;
};
}
}
#endif
gazebo::event::Events::setSelectedEntity
static EventT< void(std::string, std::string)> setSelectedEntity
An entity has been selected.
Definition: Events.hh:230
gazebo::event::Events::ConnectTimeReset
static ConnectionPtr ConnectTimeReset(T _subscriber)
Connect to the time reset signal.
Definition: Events.hh:144
gazebo::event::Events::worldUpdateEnd
static EventT< void()> worldUpdateEnd
World update has ended.
Definition: Events.hh:246
UpdateInfo.hh
gazebo::event::Events
An Event class to get notifications for simulator events.
Definition: Events.hh:37
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::event::Events::pause
static EventT< void(bool)> pause
Pause signal.
Definition: Events.hh:212
gazebo::event::Events::ConnectWorldUpdateEnd
static ConnectionPtr ConnectWorldUpdateEnd(T _subscriber)
Connect a callback to the world update end signal.
Definition: Events.hh:128
gazebo::event::Events::ConnectDiagTimerStart
static ConnectionPtr ConnectDiagTimerStart(T _subscriber)
Connect a callback to the diagnostic timer start signal.
Definition: Events.hh:192
gazebo::event::Events::ConnectBeforePhysicsUpdate
static ConnectionPtr ConnectBeforePhysicsUpdate(T _subscriber)
Connect a callback to the before physics update signal.
Definition: Events.hh:120
gazebo::event::Events::diagTimerStart
static EventT< void(std::string)> diagTimerStart
Diagnostic timer start.
Definition: Events.hh:264
Console.hh
system.hh
gazebo::event::Events::ConnectRender
static ConnectionPtr ConnectRender(T _subscriber)
Connect a callback to the render update signal.
Definition: Events.hh:176
gazebo::event::Events::createSensor
static EventT< void(sdf::ElementPtr, const std::string &, const std::string &, const uint32_t)> createSensor
Create a sensor.
Definition: Events.hh:285
gazebo::event::Events::worldUpdateBegin
static EventT< void(const common::UpdateInfo &)> worldUpdateBegin
World update has started.
Definition: Events.hh:239
gazebo::event::Events::timeReset
static EventT< void()> timeReset
Time reset signal.
Definition: Events.hh:252
gazebo::event::EventT
A class for event processing.
Definition: Event.hh:97
gazebo::event::Events::stop
static EventT< void()> stop
Simulation stop signal.
Definition: Events.hh:218
gazebo::event::Events::ConnectRemoveSensor
static ConnectionPtr ConnectRemoveSensor(T _subscriber)
Connect to the remove sensor signal.
Definition: Events.hh:152
gazebo::event::Events::ConnectPause
static ConnectionPtr ConnectPause(T _subscriber)
Connect a callback to the pause signal.
Definition: Events.hh:44
gazebo::event::Events::addEntity
static EventT< void(std::string)> addEntity
An entity has been added.
Definition: Events.hh:233
gazebo::event::Events::sigInt
static EventT< void()> sigInt
Simulation SIGINT/SIGTERM signal.
Definition: Events.hh:221
gazebo::event::Events::ConnectWorldUpdateBegin
static ConnectionPtr ConnectWorldUpdateBegin(T _subscriber)
Connect a callback to the world update start signal.
Definition: Events.hh:108
gazebo::event::Events::ConnectCreateSensor
static ConnectionPtr ConnectCreateSensor(T _subscriber)
Connect to the create sensor signal.
Definition: Events.hh:160
gazebo::event::Events::ConnectWorldCreated
static ConnectionPtr ConnectWorldCreated(T _subscriber)
Connect a callback to the world created signal.
Definition: Events.hh:68
gazebo::event::Events::deleteEntity
static EventT< void(std::string)> deleteEntity
An entity has been deleted.
Definition: Events.hh:236
gazebo::event::Events::ConnectDiagTimerStop
static ConnectionPtr ConnectDiagTimerStop(T _subscriber)
Connect a callback to the diagnostic timer stop signal.
Definition: Events.hh:200
gazebo::event::EventT::Connect
ConnectionPtr Connect(const std::function< T > &_subscriber)
Connect a callback to this event.
Definition: Event.hh:558
gazebo::event::Events::beforePhysicsUpdate
static EventT< void(const common::UpdateInfo &)> beforePhysicsUpdate
Collision detection has been done, physics update not yet.
Definition: Events.hh:243
gazebo::event::Events::worldCreated
static EventT< void(std::string)> worldCreated
A world has been created.
Definition: Events.hh:224
gazebo::event::Events::step
static EventT< void()> step
Step the simulation once signal.
Definition: Events.hh:215
gazebo::event::Events::ConnectPreRender
static ConnectionPtr ConnectPreRender(T _subscriber)
Render start signal.
Definition: Events.hh:168
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::event::Events::postRender
static EventT< void()> postRender
Post-Render.
Definition: Events.hh:261
gazebo::event::Events::ConnectSetSelectedEntity
static ConnectionPtr ConnectSetSelectedEntity(T _subscriber)
Connect a callback to the set selected entity signal.
Definition: Events.hh:84
gazebo::event::Events::render
static EventT< void()> render
Render.
Definition: Events.hh:258
gazebo::event::Events::preRender
static EventT< void()> preRender
Pre-render.
Definition: Events.hh:255
gazebo::event::Events::ConnectDeleteEntity
static ConnectionPtr ConnectDeleteEntity(T _subscriber)
Connect a callback to the delete entity signal.
Definition: Events.hh:92
gazebo::event::Events::removeSensor
static EventT< void(std::string)> removeSensor
Remove a sensor.
Definition: Events.hh:272
gazebo::event::Events::entityCreated
static EventT< void(std::string)> entityCreated
An entity has been created.
Definition: Events.hh:227
gazebo::event::Events::ConnectCreateEntity
static ConnectionPtr ConnectCreateEntity(T _subscriber)
Connect a callback to the add entity signal.
Definition: Events.hh:76
Event.hh
gazebo::event::Events::ConnectStep
static ConnectionPtr ConnectStep(T _subscriber)
Connect a callback to the step signal.
Definition: Events.hh:52
gazebo::event::Events::ConnectWorldReset
static ConnectionPtr ConnectWorldReset(T _subscriber)
Connect to the world reset signal.
Definition: Events.hh:136
gazebo::event::Events::ConnectSigInt
static ConnectionPtr ConnectSigInt(T _subscriber)
Connect a callback to the sigint event.
Definition: Events.hh:208
gazebo::common::UpdateInfo
Information for use in an update event.
Definition: UpdateInfo.hh:30
gazebo::event::Events::ConnectAddEntity
static ConnectionPtr ConnectAddEntity(T _subscriber)
Connect a callback to the add entity signal.
Definition: Events.hh:100
gazebo::event::Events::worldReset
static EventT< void()> worldReset
World reset signal.
Definition: Events.hh:249
gazebo::event::Events::diagTimerStop
static EventT< void(std::string)> diagTimerStop
Diagnostic timer stop.
Definition: Events.hh:267
gazebo::event::Events::ConnectStop
static ConnectionPtr ConnectStop(T _subscriber)
Connect a callback to the stop signal.
Definition: Events.hh:60
gazebo::event::Events::ConnectPostRender
static ConnectionPtr ConnectPostRender(T _subscriber)
Connect a callback to the post render update signal.
Definition: Events.hh:184
gazebo::gui::stop
void stop()