Remove warnings
[anna.git] / include / anna / diameter.comm / TimerManager.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_diameter_comm_TimerManager_hpp
10 #define anna_diameter_comm_TimerManager_hpp
11
12 #include <anna/config/defines.hpp>
13 #include <anna/core/util/Recycler.hpp>
14 #include <anna/core/Singleton.hpp>
15 #include <anna/timex/TimeEventObserver.hpp>
16 #include <anna/core/RuntimeException.hpp>
17
18 // Local
19 #include <anna/diameter.comm/Timer.hpp>
20
21
22 namespace anna {
23 class Millisecond;
24
25 namespace timex {
26 class Engine;
27 }
28 }
29
30 namespace anna {
31
32 namespace diameter {
33
34 namespace comm {
35
36
37 class Session;
38 class Response;
39 class LocalServer;
40
41
42 /**
43    Timer Manager for Diameter Requests and client-session events
44 */
45 class TimerManager : public anna::timex::TimeEventObserver, public anna::Singleton <TimerManager> {
46   typedef anna::Recycler <anna::diameter::comm::Timer> timer_container;
47
48   timer_container a_timers;
49   anna::timex::Engine* a_timeController;
50
51   TimerManager();
52   TimerManager(const TimerManager&);
53   virtual ~TimerManager() {;}
54
55   Timer* createTimer(Response*) throw(anna::RuntimeException);
56   Timer* createTimer(Session*, const anna::diameter::comm::Timer::Type::_v type) throw(anna::RuntimeException);
57   Timer* createTimer(LocalServer*) throw(anna::RuntimeException);
58
59   void cancelTimer(Timer*) throw();
60
61   void release(anna::timex::TimeEvent*) throw();
62
63   friend class anna::Singleton <TimerManager>;
64   friend class Response;
65   friend class Session;
66   friend class LocalServer;
67 };
68
69 }
70 }
71 }
72
73 #endif
74