ANNA Suite  2020b
Multipurpose development suite for Telco applications
Clock.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_Clock_hpp
10 #define anna_timex_Clock_hpp
11 
12 #include <anna/timex/TimeEvent.hpp>
13 
14 namespace anna {
15 
16 namespace timex {
17 
23 class Clock : public TimeEvent {
24 public:
31  Clock(const char* name, const Millisecond & timeout);
32 
37  std::string asString() const
38  {
39  std::string msg("Clock { ");
40  msg += TimeEvent::asString();
41  msg += " | Name: ";
42  msg += a_name;
43  return msg += " }";
44  }
45 
53  virtual bool tick() noexcept(false) = 0;
54 
55 private:
56  std::string a_name;
57 
58  void expire(Engine* timeController) noexcept(false);
59 };
60 
61 }
62 }
63 
64 #endif
65 
66 
Definition: Millisecond.hpp:24
virtual bool tick() noexcept(false)=0
Definition: Clock.hpp:23
Clock(const char *name, const Millisecond &timeout)
virtual std::string asString() const
Definition: TimeEvent.hpp:26
Definition: app.hpp:12
std::string asString() const
Definition: Clock.hpp:37
Definition: Engine.hpp:62