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_timex_Timer_hpp
10 #define anna_timex_Timer_hpp
11 
12 #include <anna/timex/TimeEvent.hpp>
13 
14 namespace anna {
15 
16 namespace timex {
17 
25 class Timer : public TimeEvent {
26 public:
33  Timer(const char* name, const Millisecond & timeout) :
34  TimeEvent(anna_ptrnumber_cast(this), timeout),
35  a_name(name) {
36  }
37 
42  std::string asString() const
43  {
44  std::string msg("Timer { ");
45  msg += TimeEvent::asString();
46  msg += " | Name: ";
47  msg += a_name;
48  return msg += " }";
49  }
50 
51 private:
52  std::string a_name;
53 };
54 
55 }
56 }
57 
58 #endif
59 
60 
#define anna_ptrnumber_cast(pointer)
Definition: defines.hpp:118
Definition: Millisecond.hpp:24
virtual std::string asString() const
Definition: TimeEvent.hpp:26
Definition: Timer.hpp:25
Timer(const char *name, const Millisecond &timeout)
Definition: Timer.hpp:33
Definition: app.hpp:12
std::string asString() const
Definition: Timer.hpp:42