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 (C) 2012-2014 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 #include "gazebo/util/system.hh"
26 
27 namespace gazebo
28 {
29  namespace event
30  {
33 
37  {
42  public: template<typename T>
43  static ConnectionPtr ConnectPause(T _subscriber)
44  { return pause.Connect(_subscriber); }
45 
48  public: static void DisconnectPause(ConnectionPtr _subscriber)
49  { pause.Disconnect(_subscriber); }
50 
55  public: template<typename T>
56  static ConnectionPtr ConnectStep(T _subscriber)
57  { return step.Connect(_subscriber); }
60  public: static void DisconnectStep(ConnectionPtr _subscriber)
61  { step.Disconnect(_subscriber); }
62 
67  public: template<typename T>
68  static ConnectionPtr ConnectStop(T _subscriber)
69  { return stop.Connect(_subscriber); }
72  public: static void DisconnectStop(ConnectionPtr _subscriber)
73  { stop.Disconnect(_subscriber); }
74 
79  public: template<typename T>
80  static ConnectionPtr ConnectWorldCreated(T _subscriber)
81  { return worldCreated.Connect(_subscriber); }
83  public: static void DisconnectWorldCreated(ConnectionPtr _subscriber)
84  { worldCreated.Disconnect(_subscriber); }
85 
90  public: template<typename T>
91  static ConnectionPtr ConnectCreateEntity(T _subscriber)
92  { return entityCreated.Connect(_subscriber); }
95  public: static void DisconnectCreateEntity(ConnectionPtr _subscriber)
96  { entityCreated.Disconnect(_subscriber); }
97 
102  public: template<typename T>
104  { return setSelectedEntity.Connect(_subscriber); }
107  public: static void DisconnectSetSelectedEntity(ConnectionPtr _subscriber)
108  { setSelectedEntity.Disconnect(_subscriber); }
113  public: template<typename T>
114  static ConnectionPtr ConnectDeleteEntity(T _subscriber)
115  { return deleteEntity.Connect(_subscriber); }
118  public: static void DisconnectDeleteEntity(ConnectionPtr _subscriber)
119  { deleteEntity.Disconnect(_subscriber); }
124  public: template<typename T>
125  static ConnectionPtr ConnectAddEntity(T _subscriber)
126  { return addEntity.Connect(_subscriber); }
129  public: static void DisconnectAddEntity(ConnectionPtr _subscriber)
130  { addEntity.Disconnect(_subscriber); }
131 
136  public: template<typename T>
138  { return worldUpdateBegin.Connect(_subscriber); }
139 
142  public: static void DisconnectWorldUpdateBegin(
143  ConnectionPtr _subscriber);
144 
149  public: template<typename T>
150  static ConnectionPtr ConnectWorldUpdateEnd(T _subscriber)
151  { return worldUpdateEnd.Connect(_subscriber); }
154  public: static void DisconnectWorldUpdateEnd(ConnectionPtr _subscriber)
155  { worldUpdateEnd.Disconnect(_subscriber); }
156 
161  public: template<typename T>
162  static ConnectionPtr ConnectPreRender(T _subscriber)
163  { return preRender.Connect(_subscriber); }
166  public: static void DisconnectPreRender(ConnectionPtr _subscriber)
167  { preRender.Disconnect(_subscriber); }
172  public: template<typename T>
173  static ConnectionPtr ConnectRender(T _subscriber)
174  { return render.Connect(_subscriber); }
177  public: static void DisconnectRender(ConnectionPtr _subscriber)
178  { render.Disconnect(_subscriber); }
183  public: template<typename T>
184  static ConnectionPtr ConnectPostRender(T _subscriber)
185  { return postRender.Connect(_subscriber); }
188  public: static void DisconnectPostRender(ConnectionPtr _subscriber)
189  { postRender.Disconnect(_subscriber); }
194  public: template<typename T>
195  static ConnectionPtr ConnectDiagTimerStart(T _subscriber)
196  { return diagTimerStart.Connect(_subscriber); }
199  public: static void DisconnectDiagTimerStart(ConnectionPtr _subscriber)
200  { diagTimerStart.Disconnect(_subscriber); }
205  public: template<typename T>
206  static ConnectionPtr ConnectDiagTimerStop(T _subscriber)
207  { return diagTimerStop.Connect(_subscriber); }
210  public: static void DisconnectDiagTimerStop(ConnectionPtr _subscriber)
211  { diagTimerStop.Disconnect(_subscriber); }
212 
217  public: template<typename T>
218  static ConnectionPtr ConnectSigInt(T _subscriber)
219  { return sigInt.Connect(_subscriber); }
222  public: static void DisconnectSigInt(ConnectionPtr _subscriber)
223  { sigInt.Disconnect(_subscriber); }
224 
226  public: static EventT<void (bool)> pause;
227 
229  public: static EventT<void ()> step;
230 
232  public: static EventT<void ()> stop;
233 
235  public: static EventT<void ()> sigInt;
236 
239 
242 
245 
248 
251 
254 
257 
259  public: static EventT<void ()> preRender;
260 
262  public: static EventT<void ()> render;
263 
265  public: static EventT<void ()> postRender;
266 
269 
272  };
274  }
275 }
276 #endif