CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/CondCore/ORA/src/CArrayHandler.cc

Go to the documentation of this file.
00001 #include "CArrayHandler.h"
00002 #include "ClassUtils.h"
00003 // externals
00004 #include "Reflex/Object.h"
00005 
00006 ora::CArrayIteratorHandler::CArrayIteratorHandler( const void* startAddress,
00007                                                    const Reflex::Type& iteratorReturnType ):
00008   m_returnType(iteratorReturnType),
00009   m_currentElement(startAddress){
00010 
00011 }
00012 
00013 ora::CArrayIteratorHandler::~CArrayIteratorHandler(){}
00014 
00015 void
00016 ora::CArrayIteratorHandler::increment()
00017 {
00018   m_currentElement = static_cast< const char* >( m_currentElement) + m_returnType.SizeOf();
00019 }
00020 
00021 void*
00022 ora::CArrayIteratorHandler::object()
00023 {
00024   return const_cast<void*>(m_currentElement);
00025 }
00026 
00027 Reflex::Type&
00028 ora::CArrayIteratorHandler::returnType()
00029 {
00030   return m_returnType;
00031 }
00032 
00033 ora::CArrayHandler::CArrayHandler( const Reflex::Type& dictionary ):
00034   m_type( dictionary ),
00035   m_elementType()
00036 {
00037 
00038   // find the iterator return type 
00039   Reflex::Type elementType = m_type.ToType();
00040   m_elementType = ClassUtils::resolvedType( elementType );
00041   
00042 }
00043 
00044 ora::CArrayHandler::~CArrayHandler(){
00045 }
00046 
00047 size_t
00048 ora::CArrayHandler::size( const void* )
00049 {
00050   return m_type.ArrayLength();
00051 }
00052 
00053 
00054 ora::IArrayIteratorHandler*
00055 ora::CArrayHandler::iterate( const void* address )
00056 {
00057   return new ora::CArrayIteratorHandler( address, m_elementType );
00058 }
00059 
00060 
00061 void
00062 ora::CArrayHandler::appendNewElement( void*, void* )
00063 {
00064 }
00065 
00066 void
00067 ora::CArrayHandler::clear( const void* )
00068 {
00069 }
00070 
00071 Reflex::Type&
00072 ora::CArrayHandler::iteratorReturnType()
00073 {
00074   return m_elementType;
00075 }