StdAir Logo  1.00.3
C++ Standard Airline IT Object Library
DBSessionManager.hpp
Go to the documentation of this file.
1 #ifndef __STDAIR_SVC_DBSESSIONMANAGER_HPP
2 #define __STDAIR_SVC_DBSESSIONMANAGER_HPP
3 
4 // //////////////////////////////////////////////////////////////////////
5 // Import section
6 // //////////////////////////////////////////////////////////////////////
7 // StdAir
8 #include <stdair/stdair_db.hpp>
9 
10 namespace stdair {
11 
12  // Forward declarations
13  struct BasDBParams;
14 
18  // Friend classes
19  friend class FacSupervisor;
20  friend class STDAIR_Service;
21 
22  public:
24  static DBSessionManager& instance();
25 
28  DBSession_T& getDBSession() const;
29 
30 
31  private:
38  ~DBSessionManager ();
39 
42  void dbInit (const BasDBParams&);
43 
46  void dbFinalise ();
47 
48 
49  private:
52  static void init (const BasDBParams&);
53 
55  static void clean();
56 
57 
58  private:
60  DBSession_T* _dbSession;
61  };
62 
63 }
64 #endif // __STDAIR_SVC_DBSESSIONMANAGER_HPP
Structure holding the parameters for connection to a database.
Definition: BasDBParams.hpp:19
Handle on the StdAir library context.
DBSession_T & getDBSession() const
soci::session DBSession_T
Definition: stdair_db.hpp:20
static DBSessionManager & instance()
Interface for the STDAIR Services.