ANNA Suite  2020b
Multipurpose development suite for Telco applications
TickProducer.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_internal_TickProducer_hpp
10 #define anna_timex_internal_TickProducer_hpp
11 
13 
14 namespace anna {
15 
16 namespace timex {
17 
18 class Engine;
19 
24 class TickProducer {
25 public:
26  void requestStop() { a_requestedStop = true; }
27 
28  // Para poder clonarlo
29  void setfd(const int fd) { a_fdWrite = fd; }
30 
31 private:
32  Engine& a_timeController;
33  int a_fdWrite;
34  Millisecond a_expectedTime;
35  bool a_isInPause;
36  bool a_requestedStop;
37 
38  TickProducer(Engine* timeController, const int fdWrite);
39 
40  bool isInPause() const { return a_isInPause; }
41  void setIsInPause(const bool isInPause) { a_isInPause = isInPause; }
42 
43  void tick() ;
44  void resetExpectedTime() { a_expectedTime = 0; }
45  Millisecond calculeSlice(const Millisecond & msnow) ;
46 
47  static void* exec(void* arg) ;
48 
49  friend class Engine;
50 };
51 
52 }
53 }
54 
55 #endif
Definition: Millisecond.hpp:24
void requestStop()
Definition: TickProducer.hpp:26
Definition: TickProducer.hpp:24
void setfd(const int fd)
Definition: TickProducer.hpp:29
Definition: app.hpp:12
Definition: Engine.hpp:62