CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/CondCore/ORA/src/PVectorHandler.h

Go to the documentation of this file.
00001 #ifndef INCLUDE_ORA_PVECTORHANDLER_H
00002 #define INCLUDE_ORA_PVECTORHANDLER_H
00003 
00004 #include "IArrayHandler.h"
00005 //
00006 #include <memory>
00007 // externals
00008 #include "Reflex/Reflex.h"
00009 #include "Reflex/Builder/CollectionProxy.h"
00010 
00011 namespace ora {
00012 
00013   class PVectorIteratorHandler : virtual public IArrayIteratorHandler 
00014   {
00015 
00016     public:
00018     PVectorIteratorHandler( const Reflex::Environ<long>& collEnv,
00019                             Reflex::CollFuncTable& collProxy,
00020                             const Reflex::Type& iteratorReturnType,
00021                             size_t startElement );
00022 
00024     virtual ~PVectorIteratorHandler();
00025 
00027     void increment();
00028 
00030     void* object();
00031 
00033     Reflex::Type& returnType();
00034 
00035     private:
00036 
00038     Reflex::Type m_returnType;
00039 
00041     Reflex::Environ<long> m_collEnv;
00042 
00044     Reflex::CollFuncTable& m_collProxy;
00045 
00047     void* m_currentElement;
00048 
00049     size_t m_startElement;
00050     
00051   };
00052 
00053   class PVectorHandler : virtual public IArrayHandler {
00054 
00055     public:
00057       explicit PVectorHandler( const Reflex::Type& dictionary );
00058 
00060       virtual ~PVectorHandler();
00061 
00063       size_t size( const void* address );
00064 
00066       size_t startElementIndex( const void* address );
00067 
00069       IArrayIteratorHandler* iterate( const void* address );
00070 
00072       void appendNewElement( void* address, void* data );
00073 
00075       void clear( const void* address );
00076 
00078       Reflex::Type& iteratorReturnType();
00079 
00081       bool isAssociative() const {
00082         return m_isAssociative;
00083       }
00084 
00086       size_t* persistentSize( const void* address );
00087 
00089       void finalize( void* address );
00090 
00091     private:
00093       Reflex::Type m_type;
00094 
00096       Reflex::Type m_iteratorReturnType;
00097 
00099       bool m_isAssociative;
00100 
00102       Reflex::Environ<long> m_collEnv;
00103 
00105       std::auto_ptr<Reflex::CollFuncTable> m_collProxy;
00106 
00107       size_t m_persistentSizeAttributeOffset;
00108 
00109       size_t m_vecAttributeOffset;
00110 
00111   };
00112 
00113  }
00114 
00115 #endif