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 Nate Koenig
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 #include "common/Event.hh"
22 
23 namespace gazebo
24 {
25  namespace event
26  {
29 
32  class Events
33  {
38  public: template<typename T>
39  static ConnectionPtr ConnectPause(T _subscriber)
40  { return pause.Connect(_subscriber); }
43  public: static void DisconnectPause(ConnectionPtr _subscriber)
44  { pause.Disconnect(_subscriber); }
49  public: template<typename T>
50  static ConnectionPtr ConnectStep(T _subscriber)
51  { return step.Connect(_subscriber); }
54  public: static void DisconnectStep(ConnectionPtr _subscriber)
55  { step.Disconnect(_subscriber); }
56 
61  public: template<typename T>
62  static ConnectionPtr ConnectStop(T _subscriber)
63  { return stop.Connect(_subscriber); }
66  public: static void DisconnectStop(ConnectionPtr _subscriber)
67  { stop.Disconnect(_subscriber); }
68 
73  public: template<typename T>
74  static ConnectionPtr ConnectWorldCreated(T _subscriber)
75  { return worldCreated.Connect(_subscriber); }
77  public: static void DisconnectWorldCreated(ConnectionPtr _subscriber)
78  { worldCreated.Disconnect(_subscriber); }
79 
84  public: template<typename T>
85  static ConnectionPtr ConnectCreateEntity(T _subscriber)
86  { return entityCreated.Connect(_subscriber); }
89  public: static void DisconnectCreateEntity(ConnectionPtr _subscriber)
90  { entityCreated.Disconnect(_subscriber); }
91 
96  public: template<typename T>
98  { return setSelectedEntity.Connect(_subscriber); }
101  public: static void DisconnectSetSelectedEntity(ConnectionPtr _subscriber)
102  { setSelectedEntity.Disconnect(_subscriber); }
107  public: template<typename T>
108  static ConnectionPtr ConnectDeleteEntity(T _subscriber)
109  { return deleteEntity.Connect(_subscriber); }
112  public: static void DisconnectDeleteEntity(ConnectionPtr _subscriber)
113  { deleteEntity.Disconnect(_subscriber); }
118  public: template<typename T>
119  static ConnectionPtr ConnectAddEntity(T _subscriber)
120  { return addEntity.Connect(_subscriber); }
123  public: static void DisconnectAddEntity(ConnectionPtr _subscriber)
124  { addEntity.Disconnect(_subscriber); }
125 
126 
131  public: template<typename T>
133  { return worldUpdateStart.Connect(_subscriber); }
136  public: static void DisconnectWorldUpdateStart(ConnectionPtr _subscriber)
137  { worldUpdateStart.Disconnect(_subscriber); }
142  public: template<typename T>
143  static ConnectionPtr ConnectWorldUpdateEnd(T _subscriber)
144  { return worldUpdateEnd.Connect(_subscriber); }
147  public: static void DisconnectWorldUpdateEnd(ConnectionPtr _subscriber)
148  { worldUpdateEnd.Disconnect(_subscriber); }
149 
154  public: template<typename T>
155  static ConnectionPtr ConnectPreRender(T _subscriber)
156  { return preRender.Connect(_subscriber); }
159  public: static void DisconnectPreRender(ConnectionPtr _subscriber)
160  { preRender.Disconnect(_subscriber); }
165  public: template<typename T>
166  static ConnectionPtr ConnectRender(T _subscriber)
167  { return render.Connect(_subscriber); }
170  public: static void DisconnectRender(ConnectionPtr _subscriber)
171  { render.Disconnect(_subscriber); }
176  public: template<typename T>
177  static ConnectionPtr ConnectPostRender(T _subscriber)
178  { return postRender.Connect(_subscriber); }
181  public: static void DisconnectPostRender(ConnectionPtr _subscriber)
182  { postRender.Disconnect(_subscriber); }
187  public: template<typename T>
188  static ConnectionPtr ConnectDiagTimerStart(T _subscriber)
189  { return diagTimerStart.Connect(_subscriber); }
192  public: static void DisconnectDiagTimerStart(ConnectionPtr _subscriber)
193  { diagTimerStart.Disconnect(_subscriber); }
198  public: template<typename T>
199  static ConnectionPtr ConnectDiagTimerStop(T _subscriber)
200  { return diagTimerStop.Connect(_subscriber); }
203  public: static void DisconnectDiagTimerStop(ConnectionPtr _subscriber)
204  { diagTimerStop.Disconnect(_subscriber); }
205 
207  public: static EventT<void (bool)> pause;
208 
210  public: static EventT<void ()> step;
211 
213  public: static EventT<void ()> stop;
214 
217 
220 
223 
226 
229 
232 
235 
237  public: static EventT<void ()> preRender;
238 
240  public: static EventT<void ()> render;
241 
243  public: static EventT<void ()> postRender;
244 
247 
250  };
252  }
253 }
254 #endif