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 ContainerSchema;
19  class DatabaseSession;
20  class ContainerUpdateTable;
21  class WriteBuffer;
22  class UpdateBuffer;
23  class ReadBuffer;
24  class DeleteBuffer;
25 
27  public:
29 
31 
32  void reset();
33 
34  bool next();
35 
36  void* getItem();
37 
38  void* getItemAsType( const Reflex::Type& type );
39 
40  int itemId();
41 
42  const Reflex::Type& type();
43 
44  private:
46  int m_itemId;
48  };
49 
51 
52  public:
53  DatabaseContainer( int contId, const std::string& containerName, const std::string& className,
54  unsigned int containerSize, DatabaseSession& session );
55 
56  DatabaseContainer( int contId, const std::string& containerName, const Reflex::Type& containerType,
57  DatabaseSession& session );
58 
59  virtual ~DatabaseContainer();
60 
61  int id();
62 
63  const std::string& name();
64 
65  const std::string& className();
66 
67  const Reflex::Type& type();
68 
69  const std::string& mappingVersion();
70 
71  size_t size();
72 
73  void create();
74 
75  void drop();
76 
77  void extendSchema( const Reflex::Type& dependentType );
78 
80 
81  void* fetchItem(int itemId);
82 
83  void* fetchItemAsType(int itemId, const Reflex::Type& asType);
84 
85  int insertItem( const void* data, const Reflex::Type& type );
86 
87  void updateItem( int itemId, const void* data, const Reflex::Type& type );
88 
89  void erase( int itemId );
90 
91  void flush();
92 
93  void setItemName( const std::string& name, int itemId );
94 
95  bool getNames( std::vector<std::string>& destination );
96 
97  private:
98  std::auto_ptr<ContainerSchema> m_schema;
99  std::auto_ptr<WriteBuffer> m_writeBuffer;
100  std::auto_ptr<UpdateBuffer> m_updateBuffer;
101  std::auto_ptr<ReadBuffer> m_readBuffer;
102  std::auto_ptr<DeleteBuffer> m_deleteBuffer;
104  size_t m_size;
106  };
107 
108 }
109 
110 #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)
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()
std::auto_ptr< ReadBuffer > m_readBuffer
void * fetchItem(int itemId)
std::auto_ptr< UpdateBuffer > m_updateBuffer
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