CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ObjectStreamer.h
Go to the documentation of this file.
1 #ifndef INCLUDE_ORA_OBJECTSTREAMER_H
2 #define INCLUDE_ORA_OBJECTSTREAMER_H
3 
4 #include "IRelationalStreamer.h"
6 // externals
8 
9 namespace ora {
10 
11  class MappingElement;
12  class ContainerSchema;
13  class DataElement;
14 
16  public:
17  ObjectStreamerBase( const edm::TypeWithDict& objectType, MappingElement& mapping, ContainerSchema& contSchema );
18  virtual ~ObjectStreamerBase();
19  virtual void processDataMember( DataElement& dataElement, IRelationalData& relationalData, edm::TypeWithDict& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer ) = 0;
20  void buildBaseDataMembers( DataElement& dataElement, IRelationalData& relationalData, const edm::TypeWithDict& objType, RelationalBuffer* operationBuffer );
21  bool buildDataMembers( DataElement& dataElement, IRelationalData& relationalData, RelationalBuffer* operationBuffer );
22  protected:
24  private:
27  };
28 
30 
31  public:
32 
33  ObjectWriter( const edm::TypeWithDict& objectType, MappingElement& mapping, ContainerSchema& contSchema );
34 
35  virtual ~ObjectWriter();
36 
37  bool build(DataElement& dataElement, IRelationalData& relationalData, RelationalBuffer& operationBuffer);
38 
39  void setRecordId( const std::vector<int>& identity );
40 
42  void write( int oid, const void* data );
43 
44  public:
45 
46  void processDataMember( DataElement& dataElement, IRelationalData& relationalData, edm::TypeWithDict& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer );
47 
48  private:
49 
50  std::vector< IRelationalWriter* > m_writers;
51  };
52 
54 
55  public:
56 
57  ObjectUpdater( const edm::TypeWithDict& objectType, MappingElement& mapping, ContainerSchema& contSchema );
58 
59  virtual ~ObjectUpdater();
60 
61  bool build(DataElement& dataElement, IRelationalData& relationalData, RelationalBuffer& operationBuffer);
62 
63  void setRecordId( const std::vector<int>& identity );
64 
66  void update( int oid,
67  const void* data );
68 
69  public:
70 
71  void processDataMember( DataElement& dataElement, IRelationalData& relationalData, edm::TypeWithDict& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer );
72 
73  private:
74 
75  std::vector< IRelationalUpdater* > m_updaters;
76  };
77 
79 
80  public:
81 
82  ObjectReader( const edm::TypeWithDict& objectType, MappingElement& mapping, ContainerSchema& contSchema );
83 
84  virtual ~ObjectReader();
85 
86  bool build( DataElement& offset, IRelationalData& relationalData);
87 
88  void select( int oid );
89 
90  void setRecordId( const std::vector<int>& identity );
91 
93  void read( void* destination );
94 
95  void clear();
96 
97  public:
98 
99  void processDataMember( DataElement& dataElement, IRelationalData& relationalData, edm::TypeWithDict& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer );
100 
101  private:
102 
103  std::vector< IRelationalReader* > m_readers;
104  };
105 
107  {
108  public:
109  ObjectStreamer( const edm::TypeWithDict& objectType, MappingElement& mapping, ContainerSchema& contSchema );
110 
111  ~ObjectStreamer();
112 
114 
116 
118 
119  private:
123  };
124 
125 }
126 #endif
127 
128 
129 
ObjectWriter(const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
void setRecordId(const std::vector< int > &identity)
bool build(DataElement &offset, IRelationalData &relationalData)
void update(int oid, const void *data)
Updates a data element.
MappingElement & m_mapping
IRelationalWriter * newWriter()
void processDataMember(DataElement &dataElement, IRelationalData &relationalData, edm::TypeWithDict &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)
ObjectReader(const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
IRelationalUpdater * newUpdater()
void setRecordId(const std::vector< int > &identity)
void read(void *destination)
Reads a data element.
ObjectStreamer(const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
MappingElement & m_mapping
std::vector< IRelationalReader * > m_readers
virtual void processDataMember(DataElement &dataElement, IRelationalData &relationalData, edm::TypeWithDict &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)=0
void setRecordId(const std::vector< int > &identity)
bool build(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
ObjectUpdater(const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
ObjectStreamerBase(const edm::TypeWithDict &objectType, MappingElement &mapping, ContainerSchema &contSchema)
std::vector< IRelationalWriter * > m_writers
bool buildDataMembers(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer *operationBuffer)
void processDataMember(DataElement &dataElement, IRelationalData &relationalData, edm::TypeWithDict &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)
std::vector< IRelationalUpdater * > m_updaters
void processDataMember(DataElement &dataElement, IRelationalData &relationalData, edm::TypeWithDict &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)
void buildBaseDataMembers(DataElement &dataElement, IRelationalData &relationalData, const edm::TypeWithDict &objType, RelationalBuffer *operationBuffer)
edm::TypeWithDict m_objectType
ContainerSchema & m_schema
IRelationalReader * newReader()
void select(int oid)
bool build(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
void write(int oid, const void *data)
Writes a data element.
edm::TypeWithDict m_objectType
RelationalStreamerFactory m_streamerFactory