CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RelationalBuffer.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_RELATIONALBUFFER_H
2 #define INCLUDE_ORA_RELATIONALBUFFER_H
3 
4 //
5 #include <string>
6 #include <vector>
7 #include <boost/shared_ptr.hpp>
8 //
9 #include <memory>
10 
11 namespace coral {
12  class ISchema;
13  class Blob;
14 }
15 
16 namespace ora {
17 
18  class IRelationalOperation;
19  class InsertOperation;
20  class BulkInsertOperation;
21  class MultiRecordInsertOperation;
22  class UpdateOperation;
23  class DeleteOperation;
24 
26 
27  public:
28 
29  explicit RelationalBuffer( coral::ISchema& schema );
30 
31  virtual ~RelationalBuffer();
32 
34  BulkInsertOperation& newBulkInsert( const std::string& tableName );
36  UpdateOperation& newUpdate( const std::string& tableName, bool addToResult=false );
37  DeleteOperation& newDelete( const std::string& tableName, bool addToResult=false );
38 
40 
41  void storeBlob( boost::shared_ptr<coral::Blob> blob );
42 
43  void clear();
44  bool flush();
45 
46  private:
47 
48  coral::ISchema& m_schema;
49  std::vector< std::pair<IRelationalOperation*, bool> > m_operations;
50  std::vector<RelationalBuffer*> m_volatileBuffers;
51  std::vector< boost::shared_ptr<coral::Blob> > m_blobBuffer;
52  };
53 
54 }
55 #endif
56 
57 
58 
std::vector< boost::shared_ptr< coral::Blob > > m_blobBuffer
coral::ISchema & m_schema
RelationalBuffer & addVolatileBuffer()
RelationalBuffer(coral::ISchema &schema)
InsertOperation & newInsert(const std::string &tableName)
BulkInsertOperation & newBulkInsert(const std::string &tableName)
std::vector< RelationalBuffer * > m_volatileBuffers
MultiRecordInsertOperation & newMultiRecordInsert(const std::string &tableName)
UpdateOperation & newUpdate(const std::string &tableName, bool addToResult=false)
void storeBlob(boost::shared_ptr< coral::Blob > blob)
std::vector< std::pair< IRelationalOperation *, bool > > m_operations
DeleteOperation & newDelete(const std::string &tableName, bool addToResult=false)