$treeview $search $mathjax
00001 #ifndef __STDAIR_SVC_DBSESSIONMANAGER_HPP 00002 #define __STDAIR_SVC_DBSESSIONMANAGER_HPP 00003 00004 // ////////////////////////////////////////////////////////////////////// 00005 // Import section 00006 // ////////////////////////////////////////////////////////////////////// 00007 // StdAir 00008 #include <stdair/stdair_db.hpp> 00009 00010 namespace stdair { 00011 00012 // Forward declarations 00013 struct BasDBParams; 00014 00017 class DBSessionManager { 00018 // Friend classes 00019 friend class FacSupervisor; 00020 friend class STDAIR_Service; 00021 00022 public: 00024 static DBSessionManager& instance(); 00025 00028 DBSession_T& getDBSession() const; 00029 00030 00031 private: 00034 DBSessionManager (); 00036 DBSessionManager (const DBSessionManager&); 00038 ~DBSessionManager (); 00039 00042 void dbInit (const BasDBParams&); 00043 00046 void dbFinalise (); 00047 00048 00049 private: 00052 static void init (const BasDBParams&); 00053 00055 static void clean(); 00056 00057 00058 private: 00060 DBSession_T* _dbSession; 00061 }; 00062 00063 } 00064 #endif // __STDAIR_SVC_DBSESSIONMANAGER_HPP