OpenTREP Logo  0.6.0
C++ Open Travel Request Parsing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DBSessionManager.hpp
Go to the documentation of this file.
1 #ifndef __OPENTREP_CMD_DBSESSIONMANAGER_HPP
2 #define __OPENTREP_CMD_DBSESSIONMANAGER_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 
8 // Forward declarations
9 namespace soci {
10  class session;
11 }
12 
13 namespace OPENTREP {
14 
15  // Forward declarations
16  struct DBParams;
17 
23  private:
24  // ////////////////// Getters ////////////////////
28  soci::session* getDBSession() const {
29  return _dbSession;
30  }
31 
35  soci::session& getDBSessionRef() const;
36 
37 
38  private:
39  // ////////////////// Constructors and Destructors ////////////////////
43  DBSessionManager (const DBParams&);
44 
49 
54 
59 
60  private:
64  void init (const DBParams&);
65 
66 
67  private:
68  // /////////////////////// Attributes //////////////////////
72  soci::session* _dbSession;
73  };
74 
75 }
76 #endif // __OPENTREP_CMD_DBSESSIONMANAGER_HPP
Class holding the context of the OpenTrep services.
Structure modelling a database parameters.
Definition: DBParams.hpp:25
Class handling the SOCI session.