ANNA Suite  2020b
Multipurpose development suite for Telco applications
Delivery.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_dbms_Delivery_hpp
10 #define anna_dbms_Delivery_hpp
11 
12 #include <anna/comm/Delivery.hpp>
13 
14 namespace anna {
15 
16 namespace dbms {
17 
18 class Connection;
19 
28 public:
33  Delivery(const char *name) : comm::Delivery(name) {;}
34 
46  void createConnections(Database& database, const char* prefixName, const char* user, const char* password, const int n)
47  noexcept(false);
48 
53  void addConnection(Connection* connection) noexcept(false) {
54  this->add(connection);
55  a_iiConnection = this->begin();
56  }
57 
65  Connection& getConnection() noexcept(false);
66 
67 private:
68  iterator a_iiConnection;
69 
70  void do_initialize() { a_iiConnection = begin(); }
71  comm::Resource* do_apply() noexcept(false);
72  static Connection* connection(iterator& ii) { return (Connection*) comm::Delivery::resource(ii); }
73 
74 };
75 
76 }
77 }
78 
79 #endif
Connection & getConnection() noexcept(false)
Definition: Delivery.hpp:27
Definition: Connection.hpp:38
void addConnection(Connection *connection) noexcept(false)
Definition: Delivery.hpp:53
iterator begin()
Definition: Delivery.hpp:126
Definition: Database.hpp:37
void add(Resource *resource) noexcept(false)
static Resource * resource(iterator &ii)
Definition: Delivery.hpp:170
Definition: Resource.hpp:25
Definition: app.hpp:12
Definition: Delivery.hpp:31
Resources::iterator iterator
Definition: Delivery.hpp:34
Delivery(const char *name)
Definition: Delivery.hpp:33
void createConnections(Database &database, const char *prefixName, const char *user, const char *password, const int n) noexcept(false)