CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/CondCore/ORA/src/PVectorStreamer.h

Go to the documentation of this file.
00001 #ifndef INCLUDE_ORA_PVECTORSTREAMER_H
00002 #define INCLUDE_ORA_PVECTORSTREAMER_H
00003 
00004 #include "STLContainerStreamer.h"
00005 
00006 namespace ora {
00007 
00008   class PVectorWriter: public IRelationalWriter {
00009     
00010     public:
00012       PVectorWriter( const Reflex::Type& objectType, MappingElement& mapping, ContainerSchema& contSchema );
00013       virtual ~PVectorWriter();
00014 
00015       bool build( DataElement& offset, IRelationalData& relationalData, RelationalBuffer& operationBuffer );
00016       void setRecordId( const std::vector<int>& identity );
00017       void write( int oid,const void* data );
00018 
00019     private:
00020       STLContainerWriter m_writer;
00021   };
00022   
00023   class PVectorUpdater : public IRelationalUpdater {
00024 
00025     public:
00026 
00028     PVectorUpdater(const Reflex::Type& objectType, MappingElement& mapping, ContainerSchema& contSchema );
00029     virtual ~PVectorUpdater();
00030 
00031     bool build( DataElement& offset, IRelationalData& relationalData, RelationalBuffer& operationBuffer);
00032     void setRecordId( const std::vector<int>& identity );
00033     void update( int oid,const void* data );
00034 
00035     private:
00036     RelationalBuffer* m_buffer;
00037     STLContainerWriter m_writer;
00038   };
00039 
00040   class PVectorReader : public IRelationalReader {
00041 
00042     public:
00043     
00045     PVectorReader(const Reflex::Type& objectType, MappingElement& mapping, ContainerSchema& contSchema );
00046 
00047     virtual ~PVectorReader();
00048     
00049     bool build( DataElement& offset, IRelationalData& relationalData );
00050     void select( int oid );
00051     void setRecordId( const std::vector<int>& identity );
00052     void read( void* address );
00053     void clear();
00054 
00055     private:
00056     STLContainerReader m_reader;
00057   };
00058 
00059   class PVectorStreamer : public IRelationalStreamer 
00060   {
00061     public:
00062     PVectorStreamer( const Reflex::Type& objectType, MappingElement& mapping, ContainerSchema& contSchema );
00063 
00064     ~PVectorStreamer();
00065 
00066     IRelationalWriter* newWriter();
00067 
00068     IRelationalUpdater* newUpdater();
00069 
00070     IRelationalReader* newReader();
00071     
00072     private:
00073     Reflex::Type m_objectType;
00074     MappingElement& m_mapping;
00075     ContainerSchema& m_schema;
00076   }; 
00077 
00078   
00079 }
00080 
00081 #endif
00082 
00083