ATLAS Offline Software
Loading...
Searching...
No Matches
D3PD::Var Class Reference

Description for a single variable. More...

Collaboration diagram for D3PD::Var:

Public Member Functions

 Var (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, char *defval, size_t defsize)
 Constructor.
StatusCode init (IAddVariable *tree, const std::string &prefix)
 Initialize the variable.
void resize (size_t sz, size_t pos)
 Resize the vector.
void next ()
 Move the variable pointer to the next element.
void free ()
 Free allocated storage.

Private Attributes

std::string m_name
 The variable name.
const std::type_info * m_ti
 The type of the variable element (for each object).
char ** m_addr
 Pointer to the variable pointer.
std::string m_docstring
 Documentation string.
TVirtualCollectionProxy * m_proxy
 The root collection proxy.
size_t m_valdiff
 Offset between collection elements.
void * m_contptr
 Pointer to the vector instance.
char * m_default
 Pointer to the default value for this variable, if one has been requested. We own this object.
size_t m_defsize
 Size of the object pointed to by m_default. (Should generally be the same as m_valdiff, but it may possibly be smaller due to alignment considerations.).

Detailed Description

Description for a single variable.

We need to be able to resize the vector and quickly adjust the pointer to the next entry. So we save the root collection proxy and the element-to-element to offset. So to move to a new element, all we need to do is to add the offset to the variable pointer.

The vector must have a root dictionary (but not necessarily a reflex dictionary).

Definition at line 227 of file VectorFillerToolBase.h.

Constructor & Destructor Documentation

◆ Var()

D3PD::Var::Var ( const std::string & name,
const std::type_info & ti,
void *& ptr,
const std::string & dim,
char * defval,
size_t defsize )

Constructor.

Parameters
nameThe variable name (without prefix).
tiThe element type of the variable.
ptrThe variable pointer provided by the block filler tool.
dimReserved.
defvalPointer to the default value to use for this variable. Null for no default. Of the type given by ti. Only works for basic types. We take ownership of this.
defsizeSize of the object pointed at by defval.

Member Function Documentation

◆ free()

void D3PD::Var::free ( )

Free allocated storage.

Don't do this from the destructor since these guys get used in a vector.

◆ init()

StatusCode D3PD::Var::init ( IAddVariable * tree,
const std::string & prefix )

Initialize the variable.

Parameters
treeThe parent tree.
prefixThe variable name prefix.

◆ next()

void D3PD::Var::next ( )

Move the variable pointer to the next element.

◆ resize()

void D3PD::Var::resize ( size_t sz,
size_t pos )

Resize the vector.

Parameters
szThe new vector size.
posAfter the resize, move the variable pointer to this element.

Member Data Documentation

◆ m_addr

char** D3PD::Var::m_addr
private

Pointer to the variable pointer.

Definition at line 290 of file VectorFillerToolBase.h.

◆ m_contptr

void* D3PD::Var::m_contptr
private

Pointer to the vector instance.

Definition at line 302 of file VectorFillerToolBase.h.

◆ m_default

char* D3PD::Var::m_default
private

Pointer to the default value for this variable, if one has been requested. We own this object.

Definition at line 306 of file VectorFillerToolBase.h.

◆ m_defsize

size_t D3PD::Var::m_defsize
private

Size of the object pointed to by m_default. (Should generally be the same as m_valdiff, but it may possibly be smaller due to alignment considerations.).

Definition at line 311 of file VectorFillerToolBase.h.

◆ m_docstring

std::string D3PD::Var::m_docstring
private

Documentation string.

Definition at line 293 of file VectorFillerToolBase.h.

◆ m_name

std::string D3PD::Var::m_name
private

The variable name.

Definition at line 284 of file VectorFillerToolBase.h.

◆ m_proxy

TVirtualCollectionProxy* D3PD::Var::m_proxy
private

The root collection proxy.

Definition at line 296 of file VectorFillerToolBase.h.

◆ m_ti

const std::type_info* D3PD::Var::m_ti
private

The type of the variable element (for each object).

Definition at line 287 of file VectorFillerToolBase.h.

◆ m_valdiff

size_t D3PD::Var::m_valdiff
private

Offset between collection elements.

Definition at line 299 of file VectorFillerToolBase.h.


The documentation for this class was generated from the following file: