test
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...
 
edm::TypeWithDictiteratorReturnType ()
 Returns the iterator return type. More...
 
size_t size (const void *address)
 Returns the size of the container. More...
 
 STLContainerHandler (const edm::TypeWithDict &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

TVirtualCollectionProxy * m_collProxy
 Proxy of the generic collection. More...
 
bool m_isAssociative
 Flag indicating whether the container is associative. More...
 
edm::TypeWithDict m_iteratorReturnType
 The iterator return type. More...
 
edm::TypeWithDict m_type
 The dictionary information. More...
 

Detailed Description

Definition at line 52 of file STLContainerHandler.h.

Constructor & Destructor Documentation

ora::STLContainerHandler::STLContainerHandler ( const edm::TypeWithDict dictionary)
explicit

Constructor.

Definition at line 40 of file STLContainerHandler.cc.

References GetRecoTauVFromDQM_MC_cff::cl, ora::ClassUtils::containerValueType(), edm::TypeWithDict::cppName(), edm::TypeWithDict::getClass(), ora::ClassUtils::isTypeKeyedContainer(), m_collProxy, m_isAssociative, m_iteratorReturnType, m_type, ora::ClassUtils::resolvedType(), and ora::throwException().

40  :
41  m_type( dictionary ),
43  m_isAssociative( false ),
44  m_collProxy(){
46 
47  TClass* cl = dictionary.getClass();
48  m_collProxy = cl->GetCollectionProxy();
49  if( !m_collProxy ){
50  throwException( "Cannot create \"TVirtualCollectionProxy\" for type \""+m_type.cppName()+"\"",
51  "STLContainerHandler::STLContainerHandler");
52  }
53 
54  // find the iterator return type as the member type_value of the containers
57 
58 }
edm::TypeWithDict resolvedType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:486
bool isTypeKeyedContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:250
edm::TypeWithDict m_type
The dictionary information.
TVirtualCollectionProxy * m_collProxy
Proxy of the generic collection.
TClass * getClass() const
std::string cppName() const
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
edm::TypeWithDict m_iteratorReturnType
The iterator return type.
edm::TypeWithDict containerValueType(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:410
bool m_isAssociative
Flag indicating whether the container is associative.
ora::STLContainerHandler::~STLContainerHandler ( )

Destructor.

Definition at line 60 of file STLContainerHandler.cc.

60  {
61 }

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 85 of file STLContainerHandler.cc.

85  {
86  // m_collProxy->feed_func(data,address,1);
87  m_collProxy->Insert(data, address, 1);
88 }
TVirtualCollectionProxy * m_collProxy
Proxy of the generic collection.
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 77 of file STLContainerHandler.h.

References m_isAssociative.

77 { 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 73 of file STLContainerHandler.cc.

References ora::throwException().

73  {
74  if ( ! m_iteratorReturnType ) {
75  throwException( "Missing the dictionary information for the value_type member of the container \"" +
76  m_type.cppName() + "\"",
77  "STLContainerHandler::iterate" );
78  }
79  void *addr = const_cast<void*>(address);
80  return new STLContainerIteratorHandler( addr,*m_collProxy,m_iteratorReturnType );
81 }
edm::TypeWithDict m_type
The dictionary information.
TVirtualCollectionProxy * m_collProxy
Proxy of the generic collection.
std::string cppName() const
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
edm::TypeWithDict m_iteratorReturnType
The iterator return type.
edm::TypeWithDict & ora::STLContainerHandler::iteratorReturnType ( )
virtual

Returns the iterator return type.

Implements ora::IArrayHandler.

Definition at line 99 of file STLContainerHandler.cc.

99  {
100  return m_iteratorReturnType;
101 }
edm::TypeWithDict 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 64 of file STLContainerHandler.cc.

64  {
65  //m_collEnv.fObject = const_cast<void*>(address);
66  //return *(static_cast<size_t*>(m_collProxy->size_func(&m_collEnv)));
67  TVirtualCollectionProxy::TPushPop helper(m_collProxy, const_cast<void*>(address));
68  return m_collProxy->Size();
69 }
TVirtualCollectionProxy * m_collProxy
Proxy of the generic collection.

Member Data Documentation

TVirtualCollectionProxy* ora::STLContainerHandler::m_collProxy
private

Proxy of the generic collection.

Definition at line 90 of file STLContainerHandler.h.

Referenced by STLContainerHandler().

bool ora::STLContainerHandler::m_isAssociative
private

Flag indicating whether the container is associative.

Definition at line 87 of file STLContainerHandler.h.

Referenced by isAssociative(), and STLContainerHandler().

edm::TypeWithDict ora::STLContainerHandler::m_iteratorReturnType
private

The iterator return type.

Definition at line 84 of file STLContainerHandler.h.

Referenced by STLContainerHandler().

edm::TypeWithDict ora::STLContainerHandler::m_type
private

The dictionary information.

Definition at line 81 of file STLContainerHandler.h.

Referenced by STLContainerHandler().