#include <DataElement.h>
Public Member Functions | |
DataElement & | addChild (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 DataElement * | m_parent |
Definition at line 10 of file DataElement.h.
ora::DataElement::DataElement | ( | ) |
Definition at line 3 of file DataElement.cc.
: m_parent(0), m_children(), m_declaringScopeOffset(0), m_offsetFunction(0){ }
ora::DataElement::DataElement | ( | size_t | declaringScopeOffset, |
Reflex::OffsetFunction | offsetFunction | ||
) |
Definition at line 10 of file DataElement.cc.
: m_parent(0), m_children(), m_declaringScopeOffset(declaringScopeOffset), m_offsetFunction(offsetFunc){ }
ora::DataElement::~DataElement | ( | ) | [virtual] |
Definition at line 18 of file DataElement.cc.
{ for(std::vector<DataElement*>::const_iterator iEl = m_children.begin(); iEl != m_children.end(); ++iEl ){ delete *iEl; } }
ora::DataElement & ora::DataElement::addChild | ( | size_t | declaringScopeOffset, |
Reflex::OffsetFunction | offsetFunction | ||
) |
Definition at line 26 of file DataElement.cc.
References m_parent.
Referenced by ora::ObjectStreamerBase::buildBaseDataMembers(), ora::NamedReferenceStreamerBase::buildDataElement(), ora::OraReferenceStreamerBase::buildDataElement(), ora::InlineCArrayStreamerBase::buildDataElement(), ora::ObjectStreamerBase::buildDataMembers(), ora::OraPtrReader::read(), and ora::UniqueRefReader::read().
{ DataElement* child = new DataElement( declaringScopeOffset, offsetFunction ); child->m_parent = this; m_children.push_back(child); return *child; }
void * ora::DataElement::address | ( | const void * | topLevelAddress | ) | const |
Definition at line 48 of file DataElement.cc.
References evf::evtn::offset().
Referenced by ora::OraPtrReader::read(), and ora::UniqueRefReader::read().
{ void* elementAddress = static_cast< char* >( const_cast<void*>(topLevelAddress)) + offset( topLevelAddress ); return elementAddress; }
void ora::DataElement::clear | ( | void | ) |
Definition at line 58 of file DataElement.cc.
Referenced by ora::QueryableVectorReader::build(), ora::OraPtrWriter::build(), ora::OraPtrReader::build(), and ora::OraPtrUpdater::build().
{ for(std::vector<DataElement*>::const_iterator iEl = m_children.begin(); iEl != m_children.end(); ++iEl ){ delete *iEl; } m_children.clear(); }
size_t ora::DataElement::declaringScopeOffset | ( | ) | const |
Definition at line 53 of file DataElement.cc.
{ return m_declaringScopeOffset; }
size_t ora::DataElement::offset | ( | const void * | topLevelAddress | ) | const |
Definition at line 34 of file DataElement.cc.
References evf::evtn::offset().
{ const void* address = topLevelAddress; size_t offset = m_declaringScopeOffset; if(m_parent){ size_t parentOffset = m_parent->offset( topLevelAddress ); offset += parentOffset; address = static_cast<char*>(const_cast<void*>(topLevelAddress))+parentOffset; } if(m_offsetFunction){ offset += m_offsetFunction( const_cast<void*>(address)); } return offset; }
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().