ATLAS Offline Software
Public Types | Public Member Functions | List of all members
D3PD::IReaderD3PD Class Referenceabstract

Common interface for the code generator D3PD classes. More...

#include <IReaderD3PD.h>

Inheritance diagram for D3PD::IReaderD3PD:
Collaboration diagram for D3PD::IReaderD3PD:

Public Types

typedef unsigned int Dim_t
 Currently unimplemented — see design note. More...
 

Public Member Functions

virtual ~IReaderD3PD ()
 To make vtable happy... More...
 
virtual void setIsContainer (bool isContainer)=0
 Set the "isCollection" parameter of the object. More...
 
virtual bool isContainer () const =0
 Get the "isCollection" parameter of the object. More...
 
virtual void setPrefix (const std::string &prefix)=0
 Set the common prefix of the variables. More...
 
virtual const std::string & prefix () const =0
 Get the common prefix of the variables. More...
 
virtual StatusCode createReader (const std::string &classname, const std::string &dir="./") const =0
 Function creating the D3PDReader code. More...
 
virtual StatusCode capture ()=0
 Capture the current state of all variables and write to the tuple. More...
 
virtual StatusCode clear ()=0
 Clear all the tuple variables. More...
 
virtual StatusCode redim (const Dim_t *ptr)=0
 
virtual StatusCode addMetadata (const std::string &key, const void *obj, const std::type_info &ti)=0
 Add a new piece of metadata to the tuple. More...
 
template<class T >
StatusCode addMetadata (const std::string &key, const T *obj)
 Add a new piece of metadata to the tuple. More...
 
template<class T >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring="")
 Add a variable to the tuple. More...
 
template<class T , class U >
StatusCode addVariable (const std::string &name, T *&ptr, const std::string &docstring, const U &defval)
 Add a variable to the tuple. More...
 
virtual StatusCode addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)=0
 Add a variable to the tuple. More...
 
template<class T >
StatusCode addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring="")
 Add a variable to the tuple. More...
 
template<class T , class U >
StatusCode addDimensionedVariable (const std::string &name, T *&ptr, const std::string &dim, const std::string &docstring, const U &defval)
 Add a variable to the tuple. More...
 
virtual StatusCode addDimensionedVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &dim, const std::string &docstring="", const void *defval=0)=0
 Add a variable to the tuple. More...
 

Detailed Description

Common interface for the code generator D3PD classes.

   To make D3PD::ReaderAlg independent of the concrete generator
   implementation, all the code generator D3PD classes should implement
   this interface. It's a very simple expansion of the D3PD::ID3PD
   interface...
Author
Attila Krasznahorkay Attil.nosp@m.a.Kr.nosp@m.aszna.nosp@m.hork.nosp@m.ay@ce.nosp@m.rn.c.nosp@m.h
Revision
462802
Date
2011-10-12 18:06:24 +0200 (Wed, 12 Oct 2011)

Definition at line 29 of file IReaderD3PD.h.

Member Typedef Documentation

◆ Dim_t

typedef unsigned int D3PD::ID3PD::Dim_t
inherited

Currently unimplemented — see design note.

Definition at line 52 of file ID3PD.h.

Constructor & Destructor Documentation

◆ ~IReaderD3PD()

virtual D3PD::IReaderD3PD::~IReaderD3PD ( )
inlinevirtual

To make vtable happy...

Definition at line 33 of file IReaderD3PD.h.

33 {}

Member Function Documentation

◆ addDimensionedVariable() [1/3]

virtual StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string &  name,
const std::type_info &  ti,
void *&  ptr,
const std::string &  dim,
const std::string &  docstring = "",
const void *  defval = 0 
)
pure virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Implemented in D3PD::RootD3PD, D3PD::VectorFillerToolBase, D3PD::AddVariable, D3PD::ObjectMetadata, and D3PD::RootReaderD3PDBase.

◆ addDimensionedVariable() [2/3]

template<class T , class U >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string &  name,
T *&  ptr,
const std::string &  dim,
const std::string &  docstring,
const U &  defval 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addDimensionedVariable() [3/3]

template<class T >
StatusCode D3PD::IAddVariable::addDimensionedVariable ( const std::string &  name,
T *&  ptr,
const std::string &  dim,
const std::string &  docstring = "" 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
dimDimension for the variable. (Presently unimplemented!)
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ addMetadata() [1/2]

template<class T >
StatusCode D3PD::ID3PD::addMetadata ( const std::string &  key,
const T *  obj 
)
inherited

Add a new piece of metadata to the tuple.

Parameters
key- The key for this object. Any existing object will be overwritten.
obj- Pointer to the object to write.

The interpretation of the key parameter is up to the concrete D3PD implementation. However, a key name with a trailing slash NAME/ indicates that all metadata items with this name should be grouped together in a collection called NAME (for example, in a Root directory with that name).

◆ addMetadata() [2/2]

virtual StatusCode D3PD::ID3PD::addMetadata ( const std::string &  key,
const void *  obj,
const std::type_info &  ti 
)
pure virtualinherited

Add a new piece of metadata to the tuple.

Parameters
key- The key for this object. Any existing object will be overwritten.
obj- Pointer to the object to write.
ti- Type of the object to write.

The interpretation of the key parameter is up to the concrete D3PD implementation. However, a key name with a trailing slash NAME/ indicates that all metadata items with this name should be grouped together in a collection called NAME (for example, in a Root directory with that name).

Implemented in D3PD::RootD3PD, and D3PD::RootReaderD3PDBase.

◆ addVariable() [1/3]

virtual StatusCode D3PD::IAddVariable::addVariable ( const std::string &  name,
const std::type_info &  ti,
void *&  ptr,
const std::string &  docstring = "",
const void *  defval = 0 
)
pure virtualinherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
typeThe type of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Null for no default (generally means to fill with zeros). Of the type given by ti. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

Implemented in D3PD::RootD3PD, D3PD::VectorFillerToolBase, D3PD::AddVariable, D3PD::ObjectMetadata, and D3PD::RootReaderD3PDBase.

◆ addVariable() [2/3]

template<class T , class U >
StatusCode D3PD::IAddVariable::addVariable ( const std::string &  name,
T *&  ptr,
const std::string &  docstring,
const U &  defval 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.
defvalPointer to the default value to use for this variable. Only works for basic types.

If called from the constructor, the only effect is to clear ptr.

◆ addVariable() [3/3]

template<class T >
StatusCode D3PD::IAddVariable::addVariable ( const std::string &  name,
T *&  ptr,
const std::string &  docstring = "" 
)
inherited

Add a variable to the tuple.

Parameters
nameThe name of the variable.
ptrPointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill().
docstringDocumentation string for this variable.

If called from the constructor, the only effect is to clear ptr.

◆ capture()

virtual StatusCode D3PD::ID3PD::capture ( )
pure virtualinherited

Capture the current state of all variables and write to the tuple.

Implemented in D3PD::RootD3PD, and D3PD::RootReaderD3PDBase.

◆ clear()

virtual StatusCode D3PD::ID3PD::clear ( )
pure virtualinherited

Clear all the tuple variables.

Implemented in D3PD::RootD3PD, and D3PD::RootReaderD3PDBase.

◆ createReader()

virtual StatusCode D3PD::IReaderD3PD::createReader ( const std::string &  classname,
const std::string &  dir = "./" 
) const
pure virtual

Function creating the D3PDReader code.

This function should be implemented in the child classes to generate the D3PDReader source files. It's quite a bit influenced by the currently only implementation (D3PD::RootReaderD3PD), but I believe it could be used for other backends later on as well.

Parameters
classnameName of the class to be generated
dirDirectory where the source(s) should be put
prefixCommon prefix to the declared variables

Implemented in D3PD::RootReaderD3PD_v1, and D3PD::RootReaderD3PD_v2.

◆ isContainer()

virtual bool D3PD::IReaderD3PD::isContainer ( ) const
pure virtual

Get the "isCollection" parameter of the object.

Implemented in D3PD::RootReaderD3PDBase.

◆ prefix()

virtual const std::string& D3PD::IReaderD3PD::prefix ( ) const
pure virtual

Get the common prefix of the variables.

Implemented in D3PD::RootReaderD3PDBase.

◆ redim()

virtual StatusCode D3PD::ID3PD::redim ( const Dim_t ptr)
pure virtualinherited

◆ setIsContainer()

virtual void D3PD::IReaderD3PD::setIsContainer ( bool  isContainer)
pure virtual

Set the "isCollection" parameter of the object.

Implemented in D3PD::RootReaderD3PDBase.

◆ setPrefix()

virtual void D3PD::IReaderD3PD::setPrefix ( const std::string &  prefix)
pure virtual

Set the common prefix of the variables.

Implemented in D3PD::RootReaderD3PDBase.


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