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
7 #include "Reflex/Type.h"
8 
9 namespace ora {
10 
11  class MappingElement;
12  class ContainerSchema;
13  class DataElement;
14 
16  public:
17  ObjectStreamerBase( const Reflex::Type& objectType, MappingElement& mapping, ContainerSchema& contSchema );
18  virtual ~ObjectStreamerBase();
19  virtual void processDataMember( DataElement& dataElement, IRelationalData& relationalData, Reflex::Type& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer ) = 0;
20  void buildBaseDataMembers( DataElement& dataElement, IRelationalData& relationalData, const Reflex::Type& 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 Reflex::Type& 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, Reflex::Type& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer );
47 
48  private:
49 
50  std::vector< IRelationalWriter* > m_writers;
51  };
52 
54 
55  public:
56 
57  ObjectUpdater( const Reflex::Type& 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, Reflex::Type& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer );
72 
73  private:
74 
75  std::vector< IRelationalUpdater* > m_updaters;
76  };
77 
79 
80  public:
81 
82  ObjectReader( const Reflex::Type& 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, Reflex::Type& dataMemberType, MappingElement& dataMemberMapping, RelationalBuffer* operationBuffer );
100 
101  private:
102 
103  std::vector< IRelationalReader* > m_readers;
104  };
105 
107  {
108  public:
109  ObjectStreamer( const Reflex::Type& objectType, MappingElement& mapping, ContainerSchema& contSchema );
110 
111  ~ObjectStreamer();
112 
114 
116 
118 
119  private:
123  };
124 
125 }
126 #endif
127 
128 
129 
void processDataMember(DataElement &dataElement, IRelationalData &relationalData, Reflex::Type &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)
void setRecordId(const std::vector< int > &identity)
ObjectStreamer(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
bool build(DataElement &offset, IRelationalData &relationalData)
void processDataMember(DataElement &dataElement, IRelationalData &relationalData, Reflex::Type &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)
void update(int oid, const void *data)
Updates a data element.
MappingElement & m_mapping
string destination
IRelationalWriter * newWriter()
IRelationalUpdater * newUpdater()
void setRecordId(const std::vector< int > &identity)
void read(void *destination)
Reads a data element.
ObjectReader(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
MappingElement & m_mapping
std::vector< IRelationalReader * > m_readers
ObjectWriter(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
void setRecordId(const std::vector< int > &identity)
bool build(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
virtual void processDataMember(DataElement &dataElement, IRelationalData &relationalData, Reflex::Type &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)=0
std::vector< IRelationalWriter * > m_writers
bool buildDataMembers(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer *operationBuffer)
void buildBaseDataMembers(DataElement &dataElement, IRelationalData &relationalData, const Reflex::Type &objType, RelationalBuffer *operationBuffer)
unsigned int offset(bool)
void processDataMember(DataElement &dataElement, IRelationalData &relationalData, Reflex::Type &dataMemberType, MappingElement &dataMemberMapping, RelationalBuffer *operationBuffer)
std::vector< IRelationalUpdater * > m_updaters
ObjectStreamerBase(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
ObjectUpdater(const Reflex::Type &objectType, MappingElement &mapping, ContainerSchema &contSchema)
ContainerSchema & m_schema
IRelationalReader * newReader()
void select(int oid)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
bool build(DataElement &dataElement, IRelationalData &relationalData, RelationalBuffer &operationBuffer)
void write(int oid, const void *data)
Writes a data element.
Reflex::Type m_objectType
RelationalStreamerFactory m_streamerFactory