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...
 
Reflex::Type & iteratorReturnType ()
 Returns the iterator return type. More...
 
size_t size (const void *address)
 Returns the size of the container. More...
 
 SpecialSTLContainerHandler (const Reflex::Type &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 94 of file STLContainerHandler.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 111 of file STLContainerHandler.cc.

References i, ora::ClassUtils::isTypeContainer(), m_containerHandler, m_containerOffset, and ora::throwException().

111  :
113  m_containerOffset( 0 )
114 {
115  // update dictionary to include base classes members
116  dictionary.UpdateMembers();
117  for ( unsigned int i=0;i<dictionary.DataMemberSize();i++){
118 
119  Reflex::Member field = dictionary.DataMemberAt(i);
120  Reflex::Type fieldType = field.TypeOf();
121  if ( ! fieldType ) {
122  throwException( "The dictionary of the underlying container of \"" +
123  dictionary.Name(Reflex::SCOPED|Reflex::FINAL) + "\" is not available",
124  "SpecialSTLContainerHandler" );
125  }
126  if ( ClassUtils::isTypeContainer(fieldType) ) {
127  m_containerHandler.reset( new STLContainerHandler( fieldType ) );
128  m_containerOffset = field.Offset();
129  break;
130  }
131  }
132  if ( !m_containerHandler.get() ) {
133  throwException( "Could not retrieve the underlying container of \"" +
134  dictionary.Name(Reflex::SCOPED|Reflex::FINAL) + "\" is not available",
135  "SpecialSTLContainerHandler" );
136  }
137 }
int i
Definition: DBlmapReader.cc:9
std::auto_ptr< IArrayHandler > m_containerHandler
The handler of the unserlying container.
bool isTypeContainer(const Reflex::Type &typ)
Definition: ClassUtils.cc:147
int m_containerOffset
The offset of the underlying container.
void throwException(const std::string &message, const std::string &methodName)
Definition: Exception.cc:10
ora::SpecialSTLContainerHandler::~SpecialSTLContainerHandler ( )

Destructor.

Definition at line 140 of file STLContainerHandler.cc.

141 {
142 }

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

161 {
162  m_containerHandler->appendNewElement( static_cast< char* >( address ) + m_containerOffset, data );
163 }
char * address
Definition: mlp_lapack.h:14
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 153 of file STLContainerHandler.cc.

154 {
155  return m_containerHandler->iterate( static_cast< const char* >( address ) + m_containerOffset );
156 }
char * address
Definition: mlp_lapack.h:14
std::auto_ptr< IArrayHandler > m_containerHandler
The handler of the unserlying container.
int m_containerOffset
The offset of the underlying container.
Reflex::Type & ora::SpecialSTLContainerHandler::iteratorReturnType ( )
virtual

Returns the iterator return type.

Implements ora::IArrayHandler.

Definition at line 172 of file STLContainerHandler.cc.

173 {
174  return m_containerHandler->iteratorReturnType();
175 }
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 146 of file STLContainerHandler.cc.

147 {
148  return m_containerHandler->size( static_cast< const char* >( address ) + m_containerOffset );
149 }
char * address
Definition: mlp_lapack.h:14
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 120 of file STLContainerHandler.h.

Referenced by SpecialSTLContainerHandler().

int ora::SpecialSTLContainerHandler::m_containerOffset
private

The offset of the underlying container.

Definition at line 123 of file STLContainerHandler.h.

Referenced by SpecialSTLContainerHandler().