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 2011 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  {
28  class Events
29  {
32 
37  public: template<typename T>
38  static ConnectionPtr ConnectPause(T _subscriber)
39  { return pause.Connect(_subscriber); }
42  public: static void DisconnectPause(ConnectionPtr _subscriber)
43  { pause.Disconnect(_subscriber); }
48  public: template<typename T>
49  static ConnectionPtr ConnectStep(T _subscriber)
50  { return step.Connect(_subscriber); }
53  public: static void DisconnectStep(ConnectionPtr _subscriber)
54  { step.Disconnect(_subscriber); }
55 
60  public: template<typename T>
61  static ConnectionPtr ConnectStop(T _subscriber)
62  { return stop.Connect(_subscriber); }
65  public: static void DisconnectStop(ConnectionPtr _subscriber)
66  { stop.Disconnect(_subscriber); }
67 
72  public: template<typename T>
73  static ConnectionPtr ConnectWorldCreated(T _subscriber)
74  { return worldCreated.Connect(_subscriber); }
76  public: static void DisconnectWorldCreated(ConnectionPtr _subscriber)
77  { worldCreated.Disconnect(_subscriber); }
78 
83  public: template<typename T>
84  static ConnectionPtr ConnectCreateEntity(T _subscriber)
85  { return entityCreated.Connect(_subscriber); }
88  public: static void DisconnectCreateEntity(ConnectionPtr _subscriber)
89  { entityCreated.Disconnect(_subscriber); }
90 
95  public: template<typename T>
97  { return setSelectedEntity.Connect(_subscriber); }
100  public: static void DisconnectSetSelectedEntity(ConnectionPtr _subscriber)
101  { setSelectedEntity.Disconnect(_subscriber); }
106  public: template<typename T>
107  static ConnectionPtr ConnectDeleteEntity(T _subscriber)
108  { return deleteEntity.Connect(_subscriber); }
111  public: static void DisconnectDeleteEntity(ConnectionPtr _subscriber)
112  { deleteEntity.Disconnect(_subscriber); }
117  public: template<typename T>
118  static ConnectionPtr ConnectAddEntity(T _subscriber)
119  { return addEntity.Connect(_subscriber); }
122  public: static void DisconnectAddEntity(ConnectionPtr _subscriber)
123  { addEntity.Disconnect(_subscriber); }
124 
125 
130  public: template<typename T>
132  { return worldUpdateStart.Connect(_subscriber); }
135  public: static void DisconnectWorldUpdateStart(ConnectionPtr _subscriber)
136  { worldUpdateStart.Disconnect(_subscriber); }
141  public: template<typename T>
142  static ConnectionPtr ConnectWorldUpdateEnd(T _subscriber)
143  { return worldUpdateEnd.Connect(_subscriber); }
146  public: static void DisconnectWorldUpdateEnd(ConnectionPtr _subscriber)
147  { worldUpdateEnd.Disconnect(_subscriber); }
148 
153  public: template<typename T>
154  static ConnectionPtr ConnectPreRender(T _subscriber)
155  { return preRender.Connect(_subscriber); }
158  public: static void DisconnectPreRender(ConnectionPtr _subscriber)
159  { preRender.Disconnect(_subscriber); }
164  public: template<typename T>
165  static ConnectionPtr ConnectRender(T _subscriber)
166  { return render.Connect(_subscriber); }
169  public: static void DisconnectRender(ConnectionPtr _subscriber)
170  { render.Disconnect(_subscriber); }
175  public: template<typename T>
176  static ConnectionPtr ConnectPostRender(T _subscriber)
177  { return postRender.Connect(_subscriber); }
180  public: static void DisconnectPostRender(ConnectionPtr _subscriber)
181  { postRender.Disconnect(_subscriber); }
186  public: template<typename T>
187  static ConnectionPtr ConnectDiagTimerStart(T _subscriber)
188  { return diagTimerStart.Connect(_subscriber); }
191  public: static void DisconnectDiagTimerStart(ConnectionPtr _subscriber)
192  { diagTimerStart.Disconnect(_subscriber); }
197  public: template<typename T>
198  static ConnectionPtr ConnectDiagTimerStop(T _subscriber)
199  { return diagTimerStop.Connect(_subscriber); }
202  public: static void DisconnectDiagTimerStop(ConnectionPtr _subscriber)
203  { diagTimerStop.Disconnect(_subscriber); }
204 
206  public: static EventT<void (bool)> pause;
207 
209  public: static EventT<void ()> step;
210 
212  public: static EventT<void ()> stop;
213 
216 
219 
222 
225 
228 
231 
234 
236  public: static EventT<void ()> preRender;
237 
239  public: static EventT<void ()> render;
240 
242  public: static EventT<void ()> postRender;
243 
246 
249  };
251  }
252 }
253 #endif