1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
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 //
9 #ifndef anna_test_Control_hpp
10 #define anna_test_Control_hpp
12 #include <anna/core/mt/Mutex.hpp>
13 #include <anna/core/util/Average.hpp>
14 #include <anna/core/util/Millisecond.hpp>
15 #include <anna/core/util/Microsecond.hpp>
33 class Control : public Mutex {
35 Control (comm::Communicator* engine);
37 void setDelay (const Millisecond delay) { a_delay = delay; }
38 void setMaxMessage (const int maxMessage) { a_maxMessage = maxMessage; }
40 int getMaxMessage () const { return a_maxMessage; }
42 bool canContinue (const comm::socket::Client& clientSocket) noexcept(false);
43 void delay () noexcept(false);
44 Millisecond latency (const Millisecond& init) noexcept(false);
47 void stop () noexcept(false);
49 xml::Node* asXML (xml::Node* parent) ;
52 comm::Communicator& a_engine;
54 Millisecond a_initTime;
56 Average <Microsecond> a_avgDelay;
57 Average <Millisecond> a_avgLatency;