CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TransactionCache.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_TRANSACTIONCACHE_H
2 #define INCLUDE_ORA_TRANSACTIONCACHE_H
3 
5 //
6 #include <string>
7 #include <map>
8 #include <boost/shared_ptr.hpp>
9 #include <boost/weak_ptr.hpp>
10 
11 namespace ora {
12 
13  class DatabaseContainer;
14  class DatabaseUtilitySession;
15 
17  public:
19 
20  virtual ~TransactionCache();
21 
22  void clear();
23 
24  void setDbExists( bool exists );
25 
26  bool dbExistsLoaded();
27 
28  bool dbExists();
29 
30  void addContainer( int id, const std::string& name, Handle<DatabaseContainer>& contPtr );
31 
32  void eraseContainer( int id, const std::string& name );
33 
35 
37 
38  const std::map<int, Handle<DatabaseContainer> >& containers();
39 
40  void dropDatabase();
41 
42  std::map<std::string,std::string>& dbParams();
43 
45 
47 
48  bool isLoaded();
49 
50  void setLoaded();
51 
52  void setNamedReference( const std::string& name, boost::shared_ptr<void>& data );
53 
54  boost::shared_ptr<void> getNamedReference( const std::string& name );
55 
56  void setDropPermission( bool allowed );
57  bool dropPermissionLoaded();
58  bool dropPermission();
59 
60  private:
61  void cleanUpNamedRefCache();
62 
63  private:
64  std::pair<bool,bool> m_dbExists;
65  std::map<std::string, int> m_containersByName;
66  std::map<int, Handle<DatabaseContainer> > m_containersById;
67  std::map<std::string,std::string> m_dbParams;
69  bool m_loaded;
70  std::map<std::string,boost::weak_ptr<void> > m_namedRefCache;
71  std::pair<bool,bool> m_dropPermission;
72  };
73 }
74 
75 #endif
void eraseContainer(int id, const std::string &name)
Handle< DatabaseContainer > getContainer(int id)
std::map< int, Handle< DatabaseContainer > > m_containersById
void setUtility(Handle< DatabaseUtilitySession > &utility)
void addContainer(int id, const std::string &name, Handle< DatabaseContainer > &contPtr)
Handle< DatabaseUtilitySession > utility()
std::map< std::string, int > m_containersByName
void setDbExists(bool exists)
const std::map< int, Handle< DatabaseContainer > > & containers()
std::map< std::string, boost::weak_ptr< void > > m_namedRefCache
std::map< std::string, std::string > m_dbParams
boost::shared_ptr< void > getNamedReference(const std::string &name)
Handle< DatabaseUtilitySession > m_utility
void setDropPermission(bool allowed)
std::pair< bool, bool > m_dbExists
std::pair< bool, bool > m_dropPermission
void setNamedReference(const std::string &name, boost::shared_ptr< void > &data)
std::map< std::string, std::string > & dbParams()