ANNA Suite  2020b
Multipurpose development suite for Telco applications
ServerAllocator.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_ServerAllocator_hpp
10 #define anna_comm_ServerAllocator_hpp
11 
12 #include <string>
13 
14 namespace anna {
15 
16 namespace comm {
17 
18 class Host;
19 class TransportFactory;
20 class Server;
21 
30 public:
42  ServerAllocator(const std::string& name, const Host& host, const int remotePort, const bool autoRecovery, TransportFactory* transportFactory = NULL, const bool ignoreIncomingMessages = false) :
43  a_name(name),
44  a_host(host),
45  a_remotePort(remotePort),
46  a_autoRecovery(autoRecovery),
47  a_transportFactory(transportFactory),
48  a_ignoreIncomingMessages(ignoreIncomingMessages)
49  {;}
50 
56  a_name(other.a_name),
57  a_host(other.a_host),
62  {;}
63 
67  virtual ~ServerAllocator() {;}
68 
73  const std::string& getName() const { return a_name; }
74 
79  int getRemotePort() const { return a_remotePort; }
80 
87  bool autoRecovery() const { return a_autoRecovery; }
88 
94 
100  virtual Server* apply() const ;
101 
102 protected:
103  const std::string a_name;
104  const Host& a_host;
105  const int a_remotePort;
109 };
110 
111 }
112 
113 }
114 
115 #endif
const int a_remotePort
Definition: ServerAllocator.hpp:105
const std::string & getName() const
Definition: ServerAllocator.hpp:73
Definition: Server.hpp:53
const bool a_ignoreIncomingMessages
Definition: ServerAllocator.hpp:108
Definition: ServerAllocator.hpp:29
Definition: Host.hpp:46
virtual ~ServerAllocator()
Definition: ServerAllocator.hpp:67
bool autoRecovery() const
Definition: ServerAllocator.hpp:87
bool a_autoRecovery
Definition: ServerAllocator.hpp:106
TransportFactory * a_transportFactory
Definition: ServerAllocator.hpp:107
virtual Server * apply() const
int getRemotePort() const
Definition: ServerAllocator.hpp:79
ServerAllocator(const ServerAllocator &other)
Definition: ServerAllocator.hpp:55
bool getIgnoreIncomingMessages() const
Definition: ServerAllocator.hpp:93
const Host & a_host
Definition: ServerAllocator.hpp:104
Definition: app.hpp:12
const std::string a_name
Definition: ServerAllocator.hpp:103
Definition: TransportFactory.hpp:30
ServerAllocator(const std::string &name, const Host &host, const int remotePort, const bool autoRecovery, TransportFactory *transportFactory=NULL, const bool ignoreIncomingMessages=false)
Definition: ServerAllocator.hpp:42