ANNA Suite  2020b
Multipurpose development suite for Telco applications
ConnectionRecover.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_comm_internal_ConnectionRecover_hpp
10 #define anna_comm_internal_ConnectionRecover_hpp
11 
13 
15 
16 namespace anna {
17 
18 namespace xml {
19 class Node;
20 }
21 
22 namespace comm {
23 
24 class Server;
25 class Communicator;
26 
28 public:
29  bool isRunning() const { return a_isRunning; }
30 
31  void annotateFault(Server* server) ;
32 // bool contains (Server* server) const ;
33 // void erase (Server* server) ;
34  xml::Node* asXML(xml::Node* parent) const noexcept(false);
35 
36 private:
37  typedef std::vector <Server*> break_container;
38  typedef break_container::iterator break_iterator;
39 
40  comm::Communicator& a_communicator;
41  break_container a_breaks;
42  break_iterator a_recovering;
43  bool a_isRunning;
44  Millisecond a_nextTime;
45 
46  ConnectionRecover(Communicator* communicator) : a_communicator(*communicator), a_isRunning(false) {;}
47  void tryRecover() ;
48 
49  friend class Communicator;
50 };
51 
52 }
53 }
54 
55 #endif
56 
Definition: Communicator.hpp:79
Definition: Millisecond.hpp:24
Definition: Server.hpp:53
Definition: Node.hpp:56
xml::Node Node
Definition: Node.hpp:21
Definition: app.hpp:12
bool isRunning() const
Definition: ConnectionRecover.hpp:29
Definition: ConnectionRecover.hpp:27