ANNA Suite  2020b
Multipurpose development suite for Telco applications
Connection.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_mysql_Connection_hpp
10 #define anna_dbms_mysql_Connection_hpp
11 
12 
13 #include <anna/dbms/Connection.hpp>
15 
17 
18 namespace anna {
19 
20 namespace dbms {
21 
22 class Database;
23 
24 namespace mysql {
25 
26 class Database;
27 
38 class Connection : public dbms::Connection {
39 public:
44  std::string asString() const ;
45 
50  operator st_mysql*() { return a_mysql; }
51 
52 private:
53  Database& a_mysqlDatabase;
54  st_mysql* a_mysql;
55 
56  Connection(Database& database, const std::string& name, const char* user, const char* password);
57 
58  bool isAvailable() const noexcept(false) { return a_mysql != NULL; }
59 
60  void do_commit() noexcept(false);
61  void do_rollback() ;
62  void open() noexcept(false);
63  void close() ;
64 
66 };
67 
68 }
69 }
70 }
71 
72 #endif
Definition: Connection.hpp:38
std::string asString() const
Definition: Connection.hpp:38
Definition: app.hpp:12
Definition: Database.hpp:24