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::SpecialSTLContainerHandler Class Reference

#include <STLContainerHandler.h>

Inheritance diagram for ora::SpecialSTLContainerHandler:
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...
 
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...
 
 SpecialSTLContainerHandler (const edm::TypeWithDict &dictionary)
 Constructor. More...
 
 ~SpecialSTLContainerHandler ()
 Destructor. More...
 
- Public Member Functions inherited from ora::IArrayHandler
virtual void finalize (void *)
 execute the ending procedure for the container More...
 
virtual bool isAssociative () const
 Returns the associativeness of 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

std::auto_ptr< IArrayHandlerm_containerHandler
 The handler of the unserlying container. More...
 
int m_containerOffset
 The offset of the underlying container. More...
 

Detailed Description

Definition at line 95 of file STLContainerHandler.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 103 of file STLContainerHandler.cc.

References edm::TypeWithDict::cppName(), ora::ClassUtils::isTypeContainer(), m_containerHandler, m_containerOffset, edm::MemberWithDict::offset(), ora::throwException(), and edm::MemberWithDict::typeOf().

103  :
105  m_containerOffset( 0 )
106 {
107  // update dictionary to include base classes members
108  //-ap ignore for now: dictionary.UpdateMembers();
109  edm::TypeDataMembers members(dictionary);
110  for (auto const & member : members) {
111  edm::MemberWithDict field(member);
112  edm::TypeWithDict fieldType = field.typeOf();
113  if ( ! fieldType ) {
114  throwException( "The dictionary of the underlying container of \"" +
115  dictionary.cppName() + "\" is not available",
116  "SpecialSTLContainerHandler" );
117  }
118  if ( ClassUtils::isTypeContainer(fieldType) ) {
119  m_containerHandler.reset( new STLContainerHandler( fieldType ) );
120  m_containerOffset = field.offset();
121  break;
122  }
123  }
124  if ( !m_containerHandler.get() ) {
125  throwException( "Could not retrieve the underlying container of \"" +
126  dictionary.cppName() + "\" is not available",
127  "SpecialSTLContainerHandler" );
128  }
129 }
std::auto_ptr< IArrayHandler > m_containerHandler
The handler of the unserlying container.
std::string cppName() const
int m_containerOffset
The offset of the underlying container.
void throwException(const std::string &message, const std::string &methodName) __attribute__((noreturn))
Definition: Exception.cc:10
bool isTypeContainer(const edm::TypeWithDict &typ)
Definition: ClassUtils.cc:225
ora::SpecialSTLContainerHandler::~SpecialSTLContainerHandler ( )

Destructor.

Definition at line 132 of file STLContainerHandler.cc.

133 {
134 }

Member Function Documentation

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

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

Implements ora::IArrayHandler.

Definition at line 152 of file STLContainerHandler.cc.

153 {
154  m_containerHandler->appendNewElement( static_cast< char* >( address ) + m_containerOffset, data );
155 }
std::auto_ptr< IArrayHandler > m_containerHandler
The handler of the unserlying container.
int m_containerOffset
The offset of the underlying container.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
void ora::SpecialSTLContainerHandler::clear ( const void *  address)
virtual
ora::IArrayIteratorHandler * ora::SpecialSTLContainerHandler::iterate ( const void *  address)
virtual

Returns an initialized iterator.

Implements ora::IArrayHandler.

Definition at line 145 of file STLContainerHandler.cc.

146 {
147  return m_containerHandler->iterate( static_cast< const char* >( address ) + m_containerOffset );
148 }
std::auto_ptr< IArrayHandler > m_containerHandler
The handler of the unserlying container.
int m_containerOffset
The offset of the underlying container.
edm::TypeWithDict & ora::SpecialSTLContainerHandler::iteratorReturnType ( )
virtual

Returns the iterator return type.

Implements ora::IArrayHandler.

Definition at line 164 of file STLContainerHandler.cc.

165 {
166  return m_containerHandler->iteratorReturnType();
167 }
std::auto_ptr< IArrayHandler > m_containerHandler
The handler of the unserlying container.
size_t ora::SpecialSTLContainerHandler::size ( const void *  address)
virtual

Returns the size of the container.

Implements ora::IArrayHandler.

Definition at line 138 of file STLContainerHandler.cc.

139 {
140  return m_containerHandler->size( static_cast< const char* >( address ) + m_containerOffset );
141 }
std::auto_ptr< IArrayHandler > m_containerHandler
The handler of the unserlying container.
int m_containerOffset
The offset of the underlying container.

Member Data Documentation

std::auto_ptr<IArrayHandler> ora::SpecialSTLContainerHandler::m_containerHandler
private

The handler of the unserlying container.

Definition at line 121 of file STLContainerHandler.h.

Referenced by SpecialSTLContainerHandler().

int ora::SpecialSTLContainerHandler::m_containerOffset
private

The offset of the underlying container.

Definition at line 124 of file STLContainerHandler.h.

Referenced by SpecialSTLContainerHandler().