ANNA Suite  2020b
Multipurpose development suite for Telco applications
Service.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_Service_hpp
10 #define anna_comm_Service_hpp
11 
12 #include <anna/comm/Delivery.hpp>
13 
14 namespace anna {
15 
16 namespace comm {
17 
18 class Server;
19 class Message;
20 
28 class Service : public Delivery {
29 public:
36  Service(const char* name, const bool isCritical) :
37  Delivery(name),
38  a_isCritical(isCritical) {}
39 
45  bool isCritical() const { return a_isCritical; }
46 
51  void attach(Server* server) noexcept(false);
52 
60  comm::Server* send(Message& message) noexcept(false);
61 
69  comm::Server* send(Message* message) noexcept(false);
70 
80  int broadcast(Message& message) ;
81 
91  int broadcast(Message* message) ;
92 
97  std::string asString() const ;
98 
104  xml::Node* asXML(xml::Node* parent) const ;
105 
111  static Server* server(iterator& ii) ;
112 
118  static const Server* server(const_iterator& ii) ;
119 
120 private:
121  const bool a_isCritical;
122 };
123 
124 }
125 }
126 
127 #endif
std::string asString() const
Resources::const_iterator const_iterator
Definition: Delivery.hpp:35
bool isCritical() const
Definition: Service.hpp:45
comm::Server * send(Message &message) noexcept(false)
Definition: Server.hpp:53
Definition: Node.hpp:56
static Server * server(iterator &ii)
xml::Node * asXML(xml::Node *parent) const
int broadcast(Message &message)
void attach(Server *server) noexcept(false)
Definition: Message.hpp:26
Definition: app.hpp:12
Definition: Delivery.hpp:31
Service(const char *name, const bool isCritical)
Definition: Service.hpp:36
Resources::iterator iterator
Definition: Delivery.hpp:34
Definition: Service.hpp:28