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

#include <DataElement.h>

Public Member Functions

DataElementaddChild (size_t declaringScopeOffset, Reflex::OffsetFunction offsetFunction)
 
void * address (const void *topLevelAddress) const
 
void clear ()
 
 DataElement ()
 
 DataElement (size_t declaringScopeOffset, Reflex::OffsetFunction offsetFunction)
 
size_t declaringScopeOffset () const
 
size_t offset (const void *topLevelAddress) const
 
virtual ~DataElement ()
 

Private Attributes

std::vector< DataElement * > m_children
 
size_t m_declaringScopeOffset
 
Reflex::OffsetFunction m_offsetFunction
 
const DataElementm_parent
 

Detailed Description

Definition at line 10 of file DataElement.h.

Constructor & Destructor Documentation

ora::DataElement::DataElement ( )

Definition at line 3 of file DataElement.cc.

3  :
4  m_parent(0),
5  m_children(),
8 }
Reflex::OffsetFunction m_offsetFunction
Definition: DataElement.h:29
std::vector< DataElement * > m_children
Definition: DataElement.h:27
size_t m_declaringScopeOffset
Definition: DataElement.h:28
const DataElement * m_parent
Definition: DataElement.h:26
ora::DataElement::DataElement ( size_t  declaringScopeOffset,
Reflex::OffsetFunction  offsetFunction 
)

Definition at line 10 of file DataElement.cc.

11  :
12  m_parent(0),
13  m_children(),
15  m_offsetFunction(offsetFunc){
16 }
Reflex::OffsetFunction m_offsetFunction
Definition: DataElement.h:29
size_t declaringScopeOffset() const
Definition: DataElement.cc:53
std::vector< DataElement * > m_children
Definition: DataElement.h:27
size_t m_declaringScopeOffset
Definition: DataElement.h:28
const DataElement * m_parent
Definition: DataElement.h:26
ora::DataElement::~DataElement ( )
virtual

Definition at line 18 of file DataElement.cc.

18  {
19  for(std::vector<DataElement*>::const_iterator iEl = m_children.begin();
20  iEl != m_children.end(); ++iEl ){
21  delete *iEl;
22  }
23 }
std::vector< DataElement * > m_children
Definition: DataElement.h:27

Member Function Documentation

ora::DataElement & ora::DataElement::addChild ( size_t  declaringScopeOffset,
Reflex::OffsetFunction  offsetFunction 
)
void * ora::DataElement::address ( const void *  topLevelAddress) const

Definition at line 48 of file DataElement.cc.

References evf::evtn::offset().

Referenced by ora::UniqueRefReader::read(), and ora::OraPtrReader::read().

48  {
49  void* elementAddress = static_cast< char* >( const_cast<void*>(topLevelAddress)) + offset( topLevelAddress );
50  return elementAddress;
51 }
size_t offset(const void *topLevelAddress) const
Definition: DataElement.cc:34
void ora::DataElement::clear ( void  )
size_t ora::DataElement::declaringScopeOffset ( ) const

Definition at line 53 of file DataElement.cc.

54 {
56 }
size_t m_declaringScopeOffset
Definition: DataElement.h:28
size_t ora::DataElement::offset ( const void *  topLevelAddress) const

Definition at line 34 of file DataElement.cc.

References evf::evtn::offset().

34  {
35  const void* address = topLevelAddress;
37  if(m_parent){
38  size_t parentOffset = m_parent->offset( topLevelAddress );
39  offset += parentOffset;
40  address = static_cast<char*>(const_cast<void*>(topLevelAddress))+parentOffset;
41  }
42  if(m_offsetFunction){
43  offset += m_offsetFunction( const_cast<void*>(address));
44  }
45  return offset;
46 }
char * address
Definition: mlp_lapack.h:14
Reflex::OffsetFunction m_offsetFunction
Definition: DataElement.h:29
size_t offset(const void *topLevelAddress) const
Definition: DataElement.cc:34
size_t m_declaringScopeOffset
Definition: DataElement.h:28
const DataElement * m_parent
Definition: DataElement.h:26

Member Data Documentation

std::vector<DataElement*> ora::DataElement::m_children
private

Definition at line 27 of file DataElement.h.

size_t ora::DataElement::m_declaringScopeOffset
private

Definition at line 28 of file DataElement.h.

Reflex::OffsetFunction ora::DataElement::m_offsetFunction
private

Definition at line 29 of file DataElement.h.

const DataElement* ora::DataElement::m_parent
private

Definition at line 26 of file DataElement.h.

Referenced by addChild().