ANNA Suite  2020b
Multipurpose development suite for Telco applications
Timer.hpp
Go to the documentation of this file.
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_ldap_internal_Timer_hpp
10 #define anna_ldap_internal_Timer_hpp
11 
12 #include <anna/core/Allocator.hpp>
13 
15 
16 namespace anna {
17 
18 namespace ldap {
19 
20 class Response;
21 class TimerManager;
22 
23 class Timer : public timex::Transaction {
24 public:
25  Response* getResponse() { return reinterpret_cast <Response*>(getContext()); }
26  const Response* getResponse() const { return reinterpret_cast <const Response*>(getContext()); }
27 
28  std::string asString() const ;
29 
30 private:
31  Timer() {;}
32 
33  void setResponse(Response* response) { setContext(response); }
34  void expire(timex::Engine*) noexcept(false);
35 
36  friend class ldap::TimerManager;
37  friend class Allocator<Timer>;
38 };
39 
40 }
41 }
42 
43 #endif
44 
Definition: Response.hpp:35
Definition: Timer.hpp:23
Definition: Transaction.hpp:34
Response * getResponse()
Definition: Timer.hpp:25
std::string asString() const
void setContext(void *context)
Definition: Transaction.hpp:78
Definition: Allocator.hpp:19
void * getContext()
Definition: Transaction.hpp:66
Definition: TimerManager.hpp:36
const Response * getResponse() const
Definition: Timer.hpp:26
Definition: app.hpp:12
Definition: Engine.hpp:62