All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Events.hh
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _EVENTS_HH_
18 #define _EVENTS_HH_
19 
20 #include <string>
21 
22 #include "gazebo/common/Console.hh"
24 #include "gazebo/common/Event.hh"
25 
26 namespace gazebo
27 {
28  namespace event
29  {
32 
35  class Events
36  {
41  public: template<typename T>
42  static ConnectionPtr ConnectPause(T _subscriber)
43  { return pause.Connect(_subscriber); }
44 
47  public: static void DisconnectPause(ConnectionPtr _subscriber)
48  { pause.Disconnect(_subscriber); }
49 
54  public: template<typename T>
55  static ConnectionPtr ConnectStep(T _subscriber)
56  { return step.Connect(_subscriber); }
59  public: static void DisconnectStep(ConnectionPtr _subscriber)
60  { step.Disconnect(_subscriber); }
61 
66  public: template<typename T>
67  static ConnectionPtr ConnectStop(T _subscriber)
68  { return stop.Connect(_subscriber); }
71  public: static void DisconnectStop(ConnectionPtr _subscriber)
72  { stop.Disconnect(_subscriber); }
73 
78  public: template<typename T>
79  static ConnectionPtr ConnectWorldCreated(T _subscriber)
80  { return worldCreated.Connect(_subscriber); }
82  public: static void DisconnectWorldCreated(ConnectionPtr _subscriber)
83  { worldCreated.Disconnect(_subscriber); }
84 
89  public: template<typename T>
90  static ConnectionPtr ConnectCreateEntity(T _subscriber)
91  { return entityCreated.Connect(_subscriber); }
94  public: static void DisconnectCreateEntity(ConnectionPtr _subscriber)
95  { entityCreated.Disconnect(_subscriber); }
96 
101  public: template<typename T>
103  { return setSelectedEntity.Connect(_subscriber); }
106  public: static void DisconnectSetSelectedEntity(ConnectionPtr _subscriber)
107  { setSelectedEntity.Disconnect(_subscriber); }
112  public: template<typename T>
113  static ConnectionPtr ConnectDeleteEntity(T _subscriber)
114  { return deleteEntity.Connect(_subscriber); }
117  public: static void DisconnectDeleteEntity(ConnectionPtr _subscriber)
118  { deleteEntity.Disconnect(_subscriber); }
123  public: template<typename T>
124  static ConnectionPtr ConnectAddEntity(T _subscriber)
125  { return addEntity.Connect(_subscriber); }
128  public: static void DisconnectAddEntity(ConnectionPtr _subscriber)
129  { addEntity.Disconnect(_subscriber); }
130 
135  public: template<typename T>
137  { return worldUpdateBegin.Connect(_subscriber); }
138 
141  public: static void DisconnectWorldUpdateBegin(
142  ConnectionPtr _subscriber);
143 
148  public: template<typename T>
149  static ConnectionPtr ConnectWorldUpdateEnd(T _subscriber)
150  { return worldUpdateEnd.Connect(_subscriber); }
153  public: static void DisconnectWorldUpdateEnd(ConnectionPtr _subscriber)
154  { worldUpdateEnd.Disconnect(_subscriber); }
155 
160  public: template<typename T>
161  static ConnectionPtr ConnectPreRender(T _subscriber)
162  { return preRender.Connect(_subscriber); }
165  public: static void DisconnectPreRender(ConnectionPtr _subscriber)
166  { preRender.Disconnect(_subscriber); }
171  public: template<typename T>
172  static ConnectionPtr ConnectRender(T _subscriber)
173  { return render.Connect(_subscriber); }
176  public: static void DisconnectRender(ConnectionPtr _subscriber)
177  { render.Disconnect(_subscriber); }
182  public: template<typename T>
183  static ConnectionPtr ConnectPostRender(T _subscriber)
184  { return postRender.Connect(_subscriber); }
187  public: static void DisconnectPostRender(ConnectionPtr _subscriber)
188  { postRender.Disconnect(_subscriber); }
193  public: template<typename T>
194  static ConnectionPtr ConnectDiagTimerStart(T _subscriber)
195  { return diagTimerStart.Connect(_subscriber); }
198  public: static void DisconnectDiagTimerStart(ConnectionPtr _subscriber)
199  { diagTimerStart.Disconnect(_subscriber); }
204  public: template<typename T>
205  static ConnectionPtr ConnectDiagTimerStop(T _subscriber)
206  { return diagTimerStop.Connect(_subscriber); }
209  public: static void DisconnectDiagTimerStop(ConnectionPtr _subscriber)
210  { diagTimerStop.Disconnect(_subscriber); }
211 
216  public: template<typename T>
217  static ConnectionPtr ConnectSigInt(T _subscriber)
218  { return sigInt.Connect(_subscriber); }
221  public: static void DisconnectSigInt(ConnectionPtr _subscriber)
222  { sigInt.Disconnect(_subscriber); }
223 
225  public: static EventT<void (bool)> pause;
226 
228  public: static EventT<void ()> step;
229 
231  public: static EventT<void ()> stop;
232 
234  public: static EventT<void ()> sigInt;
235 
238 
241 
244 
247 
250 
253 
256 
258  public: static EventT<void ()> preRender;
259 
261  public: static EventT<void ()> render;
262 
264  public: static EventT<void ()> postRender;
265 
268 
271  };
273  }
274 }
275 #endif