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 Reflex {
13  class Type;
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 Reflex::Type& type );
40 
41  int itemId();
42 
43  const Reflex::Type& 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 Reflex::Type& 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 Reflex::Type& 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 Reflex::Type& 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 Reflex::Type& asType);
91 
92  int insertItem( const void* data, const Reflex::Type& type );
93 
94  void updateItem( int itemId, const void* data, const Reflex::Type& 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:22
const std::string & name()
DatabaseContainer(int contId, const std::string &containerName, const std::string &className, unsigned int containerSize, DatabaseSession &session)
const Reflex::Type & type()
std::auto_ptr< WriteBuffer > m_writeBuffer
void updateItem(int itemId, const void *data, const Reflex::Type &type)
IDatabaseSchema & m_dbSchema
int insertItem(const void *data, const Reflex::Type &type)
bool getNames(std::vector< std::string > &destination)
void * getItemAsType(const Reflex::Type &type)
const Reflex::Type & type()
std::auto_ptr< DeleteBuffer > m_deleteBuffer
std::auto_ptr< ContainerSchema > m_schema
const std::string & className()
SelectOperation m_query
void extendSchema(const Reflex::Type &dependentType)
IteratorBuffer(ContainerSchema &schema, ReadBuffer &buffer)
ContainerUpdateTable & m_containerUpdateTable
const std::string & mappingVersion()
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 setItemName(const std::string &name, int itemId)
Handle< IteratorBuffer > iteratorBuffer()
void * fetchItemAsType(int itemId, const Reflex::Type &asType)
ReadBuffer & m_readBuffer
Handle< IteratorBuffer > m_iteratorBuffer