CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DatabaseContainer.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_DATABASECONTAINER_H
2 #define INCLUDE_ORA_DATABASECONTAINER_H
3 
5 #include "RelationalOperation.h"
6 //
7 #include <string>
8 #include <vector>
9 #include <memory>
10 #include <typeinfo>
11 
12 namespace edm {
13  class TypeWithDict;
14 }
15 
16 namespace ora {
17 
18  class IDatabaseSchema;
19  class ContainerSchema;
20  class DatabaseSession;
21  class ContainerUpdateTable;
22  class WriteBuffer;
23  class UpdateBuffer;
24  class ReadBuffer;
25  class DeleteBuffer;
26 
28  public:
30 
32 
33  void reset();
34 
35  bool next();
36 
37  void* getItem();
38 
39  void* getItemAsType( const edm::TypeWithDict& type );
40 
41  int itemId();
42 
43  const edm::TypeWithDict& type();
44 
45  private:
47  int m_itemId;
49  };
50 
52 
53  public:
54  DatabaseContainer( int contId, const std::string& containerName, const std::string& className,
55  unsigned int containerSize, DatabaseSession& session );
56 
57  DatabaseContainer( int contId, const std::string& containerName, const edm::TypeWithDict& containerType,
58  DatabaseSession& session );
59 
60  virtual ~DatabaseContainer();
61 
62  int id();
63 
64  const std::string& name();
65 
66  const std::string& className();
67 
68  const edm::TypeWithDict& type();
69 
70  const std::string& mappingVersion();
71 
72  size_t size();
73 
74  void create();
75 
76  void drop();
77 
78  void extendSchema( const edm::TypeWithDict& dependentType );
79 
80  void setAccessPermission( const std::string& principal, bool forWrite );
81 
83 
84  bool lock();
85 
86  bool isLocked();
87 
88  void* fetchItem(int itemId);
89 
90  void* fetchItemAsType(int itemId, const edm::TypeWithDict& asType);
91 
92  int insertItem( const void* data, const edm::TypeWithDict& type );
93 
94  void updateItem( int itemId, const void* data, const edm::TypeWithDict& type );
95 
96  void erase( int itemId );
97 
98  void flush();
99 
100  void setItemName( const std::string& name, int itemId );
101 
102  bool getNames( std::vector<std::string>& destination );
103 
104  private:
106  std::auto_ptr<ContainerSchema> m_schema;
107  std::auto_ptr<WriteBuffer> m_writeBuffer;
108  std::auto_ptr<UpdateBuffer> m_updateBuffer;
109  std::auto_ptr<ReadBuffer> m_readBuffer;
110  std::auto_ptr<DeleteBuffer> m_deleteBuffer;
112  size_t m_size;
114  bool m_lock;
115  };
116 
117 }
118 
119 #endif
type
Definition: HCALResponse.h:21
const std::string & name()
DatabaseContainer(int contId, const std::string &containerName, const std::string &className, unsigned int containerSize, DatabaseSession &session)
std::auto_ptr< WriteBuffer > m_writeBuffer
string destination
IDatabaseSchema & m_dbSchema
bool getNames(std::vector< std::string > &destination)
const edm::TypeWithDict & type()
const edm::TypeWithDict & type()
std::auto_ptr< DeleteBuffer > m_deleteBuffer
std::auto_ptr< ContainerSchema > m_schema
int insertItem(const void *data, const edm::TypeWithDict &type)
const std::string & className()
SelectOperation m_query
IteratorBuffer(ContainerSchema &schema, ReadBuffer &buffer)
ContainerUpdateTable & m_containerUpdateTable
const std::string & mappingVersion()
void extendSchema(const edm::TypeWithDict &dependentType)
void setAccessPermission(const std::string &principal, bool forWrite)
std::auto_ptr< ReadBuffer > m_readBuffer
void * fetchItem(int itemId)
std::auto_ptr< UpdateBuffer > m_updateBuffer
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void updateItem(int itemId, const void *data, const edm::TypeWithDict &type)
void setItemName(const std::string &name, int itemId)
void * getItemAsType(const edm::TypeWithDict &type)
Handle< IteratorBuffer > iteratorBuffer()
ReadBuffer & m_readBuffer
void * fetchItemAsType(int itemId, const edm::TypeWithDict &asType)
Handle< IteratorBuffer > m_iteratorBuffer