8 Reflex::CollFuncTable& collProxy,
11 m_returnType(iteratorReturnType),
13 m_collProxy(collProxy),
15 m_startElement(startElement){
21 while(i<startElement){
35 m_currentElement = m_collProxy.next_func(&m_collEnv);
40 return m_currentElement;
50 m_iteratorReturnType(),
51 m_isAssociative(
false ),
54 m_persistentSizeAttributeOffset(0),
55 m_vecAttributeOffset(0)
57 Reflex::Member privateVectorAttribute =
m_type.DataMemberByName(
"m_vec");
58 if(privateVectorAttribute){
60 Reflex::Member
method = privateVectorAttribute.TypeOf().MemberByName(
"createCollFuncTable");
62 Reflex::CollFuncTable* collProxyPtr;
63 method.Invoke(collProxyPtr);
67 throwException(
"Cannot find \"createCollFuncTable\" function for type \""+
m_type.Name(Reflex::SCOPED)+
"\"",
68 "PVectorHandler::PVectorHandler");
72 Reflex::Member persistentSizeAttribute =
m_type.DataMemberByName(
"m_persistentSize");
73 if( persistentSizeAttribute ){
87 m_collEnv.fObject =
static_cast<char*
>(
const_cast<void*
>(
address))+m_vecAttributeOffset;
88 size_t transientSize = *(
static_cast<size_t*
>(m_collProxy->size_func(&m_collEnv)));
94 const void* persistentSizeAddress =
static_cast<const char *
>(
address) + m_persistentSizeAttributeOffset;
95 size_t persistentSize = *
static_cast<const size_t*
>(persistentSizeAddress);
96 size_t transientSize = *(
static_cast<size_t*
>(m_collProxy->size_func(&m_collEnv)));
97 size_t startElement = 0;
98 if(persistentSize < transientSize) startElement = persistentSize;
103 void* persistentSizeAddress =
static_cast<char*
>(
const_cast<void*
>(
address))+m_persistentSizeAttributeOffset;
104 return static_cast<size_t*
>(persistentSizeAddress);
109 if ( ! m_iteratorReturnType ) {
110 throwException(
"Missing the dictionary information for the value_type member of the container \"" +
111 m_type.Name(Reflex::SCOPED|Reflex::FINAL) +
"\"",
114 m_collEnv.fObject =
static_cast<char*
>(
const_cast<void*
>(
address))+m_vecAttributeOffset;
115 return new PVectorIteratorHandler( m_collEnv,*m_collProxy,m_iteratorReturnType,startElementIndex(address) );
120 void* dest_address =
static_cast<char*
>(
address)+m_vecAttributeOffset;
121 #if ROOT_VERSION_CODE < ROOT_VERSION(5,28,0)
122 m_collEnv.fObject = dest_address;
124 m_collEnv.fStart =
data;
125 m_collProxy->feed_func(&m_collEnv);
127 m_collProxy->feed_func(data,dest_address,1);
133 m_collEnv.fObject =
static_cast<char*
>(
const_cast<void*
>(
address))+m_vecAttributeOffset;
134 m_collProxy->clear_func(&m_collEnv);
139 return m_iteratorReturnType;
143 size_t transSize =
size( address );
144 void* persistentSizeAttributeAddress =
static_cast<char*
>(
address)+m_persistentSizeAttributeOffset;
145 *
static_cast<size_t*
>(persistentSizeAttributeAddress) = transSize;
size_t m_persistentSizeAttributeOffset
Reflex::Type & iteratorReturnType()
Returns the iterator return type.
Reflex::Type m_type
The dictionary information.
PVectorIteratorHandler(const Reflex::Environ< long > &collEnv, Reflex::CollFuncTable &collProxy, const Reflex::Type &iteratorReturnType, size_t startElement)
Constructor.
size_t size(const void *address)
Returns the size of the container.
void finalize(void *address)
execute the ending procedure for the container
Reflex::Type m_iteratorReturnType
The iterator return type.
size_t m_vecAttributeOffset
void appendNewElement(void *address, void *data)
Appends a new element and returns its address of the object reference.
Reflex::Environ< long > m_collEnv
Structure containing parameters of the collection instance.
Reflex::CollFuncTable & m_collProxy
Proxy of the generic collection.
virtual ~PVectorHandler()
Destructor.
void increment()
Increments itself.
Reflex::Type containerValueType(const Reflex::Type &typ)
size_t startElementIndex(const void *address)
Returns the index of the first element.
Reflex::Type resolvedType(const Reflex::Type &typ)
void * object()
Returns the current object.
std::auto_ptr< Reflex::CollFuncTable > m_collProxy
Proxy of the generic collection.
IArrayIteratorHandler * iterate(const void *address)
Returns an initialized iterator.
char data[epos_bytes_allocation]
Reflex::Type & returnType()
Returns the return type of the iterator dereference method.
size_t * persistentSize(const void *address)
Returns the persistent size of the container.
void throwException(const std::string &message, const std::string &methodName)
void * m_currentElement
Current element object pointer.
PVectorHandler(const Reflex::Type &dictionary)
Constructor.
tuple size
Write out results.
virtual ~PVectorIteratorHandler()
Destructor.
void clear(const void *address)
Clear the content of the container.