CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ora::STLContainerHandler Class Reference

#include <STLContainerHandler.h>

Inheritance diagram for ora::STLContainerHandler:
ora::IArrayHandler

Public Member Functions

void appendNewElement (void *address, void *data)
 Appends a new element and returns its address of the object reference. More...
 
void clear (const void *address)
 Clear the content of the container. More...
 
bool isAssociative () const
 Returns the associativeness of the container. More...
 
IArrayIteratorHandleriterate (const void *address)
 Returns an initialized iterator. More...
 
Reflex::Type & iteratorReturnType ()
 Returns the iterator return type. More...
 
size_t size (const void *address)
 Returns the size of the container. More...
 
 STLContainerHandler (const Reflex::Type &dictionary)
 Constructor. More...
 
 ~STLContainerHandler ()
 Destructor. More...
 
- Public Member Functions inherited from ora::IArrayHandler
virtual void finalize (void *)
 execute the ending procedure for the container More...
 
virtual size_t * persistentSize (const void *address)
 Returns the size of the container. Only differs in the PVector. More...
 
virtual size_t startElementIndex (const void *)
 Returns the index of the first element. More...
 
virtual ~IArrayHandler ()
 Destructor. More...
 

Private Attributes

Reflex::Environ< long > m_collEnv
 Structure containing parameters of the collection instance. More...
 
std::auto_ptr
< Reflex::CollFuncTable > 
m_collProxy
 Proxy of the generic collection. More...
 
bool m_isAssociative
 Flag indicating whether the container is associative. More...
 
Reflex::Type m_iteratorReturnType
 The iterator return type. More...
 
Reflex::Type m_type
 The dictionary information. More...
 

Detailed Description

Definition at line 48 of file STLContainerHandler.h.

Constructor & Destructor Documentation

ora::STLContainerHandler::STLContainerHandler ( const Reflex::Type &  dictionary)
explicit

Constructor.

Definition at line 41 of file STLContainerHandler.cc.

References ora::ClassUtils::containerValueType(), ora::ClassUtils::isTypeKeyedContainer(), m_collProxy, m_isAssociative, m_iteratorReturnType, m_type, PFRecoTauDiscriminationAgainstElectronMVA2_cfi::method, ora::ClassUtils::resolvedType(), and ora::throwException().

41  :
42  m_type( dictionary ),
44  m_isAssociative( false ),
45  m_collEnv(),
46  m_collProxy(){
48 
49  Reflex::Member method = m_type.MemberByName("createCollFuncTable");
50  if(method){
51  Reflex::CollFuncTable* collProxyPtr;
52  method.Invoke( collProxyPtr );
53  m_collProxy.reset( collProxyPtr );
54  }
55  if( !m_collProxy.get() ){
56  throwException( "Cannot find \"createCollFuncTable\" function for type \""+m_type.Name(Reflex::SCOPED)+"\"",
57  "STLContainerHandler::STLContainerHandler");
58  }
59 
60  // find the iterator return type as the member type_value of the containers
63 
64 }
Reflex::Type m_iteratorReturnType
The iterator return type.
Reflex::Environ< long > m_collEnv
Structure containing parameters of the collection instance.
std::auto_ptr< Reflex::CollFuncTable > m_collProxy
Proxy of the generic collection.
Reflex::Type containerValueType(const Reflex::Type &typ)
Definition: ClassUtils.cc:341
Reflex::Type resolvedType(const Reflex::Type &typ)
Definition: ClassUtils.cc:404
bool isTypeKeyedContainer(const Reflex::Type &typ)
Definition: ClassUtils.cc:173
Reflex::Type m_type
The dictionary information.
bool m_isAssociative
Flag indicating whether the container is associative.
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
ora::STLContainerHandler::~STLContainerHandler ( )

Destructor.

Definition at line 66 of file STLContainerHandler.cc.

66  {
67 }

Member Function Documentation

void ora::STLContainerHandler::appendNewElement ( void *  address,
void *  data 
)
virtual

Appends a new element and returns its address of the object reference.

Implements ora::IArrayHandler.

Definition at line 89 of file STLContainerHandler.cc.

References data.

89  {
90 #if ROOT_VERSION_CODE < ROOT_VERSION(5,28,0)
91  m_collEnv.fObject = address;
92  m_collEnv.fSize = 1;
93  m_collEnv.fStart = data;
94  m_collProxy->feed_func(&m_collEnv);
95 #else
96  m_collProxy->feed_func(data,address,1);
97 #endif
98 }
char * address
Definition: mlp_lapack.h:14
Reflex::Environ< long > m_collEnv
Structure containing parameters of the collection instance.
std::auto_ptr< Reflex::CollFuncTable > m_collProxy
Proxy of the generic collection.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void ora::STLContainerHandler::clear ( const void *  address)
virtual
bool ora::STLContainerHandler::isAssociative ( ) const
inlinevirtual

Returns the associativeness of the container.

Reimplemented from ora::IArrayHandler.

Definition at line 73 of file STLContainerHandler.h.

References m_isAssociative.

73 { return m_isAssociative; }
bool m_isAssociative
Flag indicating whether the container is associative.
ora::IArrayIteratorHandler * ora::STLContainerHandler::iterate ( const void *  address)
virtual

Returns an initialized iterator.

Implements ora::IArrayHandler.

Definition at line 77 of file STLContainerHandler.cc.

References ora::throwException().

77  {
78  if ( ! m_iteratorReturnType ) {
79  throwException( "Missing the dictionary information for the value_type member of the container \"" +
80  m_type.Name(Reflex::SCOPED|Reflex::FINAL) + "\"",
81  "STLContainerHandler::iterate" );
82  }
83  m_collEnv.fObject = const_cast<void*>(address);
84  return new STLContainerIteratorHandler( m_collEnv,*m_collProxy,m_iteratorReturnType );
85 }
char * address
Definition: mlp_lapack.h:14
Reflex::Type m_iteratorReturnType
The iterator return type.
Reflex::Environ< long > m_collEnv
Structure containing parameters of the collection instance.
std::auto_ptr< Reflex::CollFuncTable > m_collProxy
Proxy of the generic collection.
Reflex::Type m_type
The dictionary information.
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
Reflex::Type & ora::STLContainerHandler::iteratorReturnType ( )
virtual

Returns the iterator return type.

Implements ora::IArrayHandler.

Definition at line 107 of file STLContainerHandler.cc.

107  {
108  return m_iteratorReturnType;
109 }
Reflex::Type m_iteratorReturnType
The iterator return type.
size_t ora::STLContainerHandler::size ( const void *  address)
virtual

Returns the size of the container.

Implements ora::IArrayHandler.

Definition at line 70 of file STLContainerHandler.cc.

70  {
71  m_collEnv.fObject = const_cast<void*>(address);
72  return *(static_cast<size_t*>(m_collProxy->size_func(&m_collEnv)));
73 }
char * address
Definition: mlp_lapack.h:14
Reflex::Environ< long > m_collEnv
Structure containing parameters of the collection instance.
std::auto_ptr< Reflex::CollFuncTable > m_collProxy
Proxy of the generic collection.

Member Data Documentation

Reflex::Environ<long> ora::STLContainerHandler::m_collEnv
private

Structure containing parameters of the collection instance.

Definition at line 86 of file STLContainerHandler.h.

std::auto_ptr<Reflex::CollFuncTable> ora::STLContainerHandler::m_collProxy
private

Proxy of the generic collection.

Definition at line 89 of file STLContainerHandler.h.

Referenced by STLContainerHandler().

bool ora::STLContainerHandler::m_isAssociative
private

Flag indicating whether the container is associative.

Definition at line 83 of file STLContainerHandler.h.

Referenced by isAssociative(), and STLContainerHandler().

Reflex::Type ora::STLContainerHandler::m_iteratorReturnType
private

The iterator return type.

Definition at line 80 of file STLContainerHandler.h.

Referenced by STLContainerHandler().

Reflex::Type ora::STLContainerHandler::m_type
private

The dictionary information.

Definition at line 77 of file STLContainerHandler.h.

Referenced by STLContainerHandler().