ANNA Suite  2020b
Multipurpose development suite for Telco applications
Communicator.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_test_Communicator_hpp
10 #define anna_test_Communicator_hpp
11 
13 
14 namespace test {
15 
16 using namespace anna;
17 
19 public:
20  Communicator () : comm::Communicator (),
21  a_maxMessage (-1),
22  a_messageCounter (0),
23  a_successCounter (0),
24  a_initTime (0),
25  a_avgDelay ("AvgDelay"),
26  a_delay (0)
27  {;}
28 
29  void setDelay (const Millisecond delay) { a_delay = delay; }
30  void setMaxMessage (const int maxMessage) { a_maxMessage = maxMessage; }
31 
32  int getMaxMessage () const { return a_maxMessage; }
33  int getMessage () const { return a_messageCounter; }
34 
35  bool canContinue (const comm::ClientSocket&) noexcept(false);
36  void delay () noexcept(false);
37 
38  void terminate () ;
39 private:
40  Millisecond a_delay;
41  Millisecond a_initTime;
42  int a_maxMessage;
43  int a_messageCounter;
44  int a_successCounter;
45  Average <Microsecond> a_avgDelay;
46 
47  void eventOverQuota (const comm::ClientSocket&) ;
48 
49 };
50 
51 }
52 
53 #endif
Definition: Communicator.hpp:79
Definition: Millisecond.hpp:24
int getMessage() const
Definition: Communicator.hpp:33
Definition: Communicator.hpp:14
Definition: Average.hpp:24
int getMaxMessage() const
Definition: Communicator.hpp:32
Definition: Communicator.hpp:18
Definition: ClientSocket.hpp:38
void setDelay(const Millisecond delay)
Definition: Communicator.hpp:29
Communicator()
Definition: Communicator.hpp:20
Definition: app.hpp:12
void setMaxMessage(const int maxMessage)
Definition: Communicator.hpp:30