ATLAS Offline Software
|
Base class for all ROOT-based code generators. More...
#include <RootReaderD3PDBase.h>
Public Types | |
typedef unsigned int | Dim_t |
Currently unimplemented — see design note. More... | |
Public Member Functions | |
RootReaderD3PDBase () | |
Quite empty constructor. More... | |
virtual StatusCode | addVariable (const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0) |
Main function for adding a variable to the D3PD. 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) |
Function currently not used by the D3PDMaker code. More... | |
virtual StatusCode | addMetadata (const std::string &key, const void *obj, const std::type_info &ti) |
Function adding metadata to the D3PD. Not implemented here! More... | |
virtual StatusCode | capture () |
Function capturing the current value of the D3PD variables. Not implemented here! More... | |
virtual StatusCode | clear () |
Function clearing the D3PD variables. Not implemented here! More... | |
virtual StatusCode | redim (const Dim_t *ptr) |
Function currently not used by the D3PDMaker code. More... | |
virtual void | setIsContainer (bool isContainer) |
Set the "isCollection" parameter of the object. More... | |
virtual bool | isContainer () const |
Get the "isCollection" parameter of the object. More... | |
virtual void | setPrefix (const std::string &prefix) |
Set the common prefix of the variables. More... | |
virtual const std::string & | prefix () const |
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... | |
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... | |
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... | |
Protected Member Functions | |
void | addSTLHeader (std::ostream &out, const char *name) const |
Function adding STL include statements to the header when needed. More... | |
Protected Attributes | |
ObjectMetadata | m_metadata |
Object holding the information about the variables. More... | |
Base class for all ROOT-based code generators.
To be able to simply create multiple different code generators, this class collects the functionality that all classes need to implement in the same way. Classes inheriting from this one only need to implement the <code>createReader(...)</code> function. (With as complicated code as they'd like...)
Definition at line 38 of file RootReaderD3PDBase.h.
|
inherited |
D3PD::RootReaderD3PDBase::RootReaderD3PDBase | ( | ) |
Quite empty constructor.
Definition at line 80 of file RootReaderD3PDBase.cxx.
|
virtual |
Function currently not used by the D3PDMaker code.
Implements D3PD::IAddVariable.
Definition at line 95 of file RootReaderD3PDBase.cxx.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
defval | Pointer 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
.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
dim | Dimension for the variable. (Presently unimplemented!) |
docstring | Documentation string for this variable. |
If called from the constructor, the only effect is to clear ptr
.
|
inherited |
Add a new piece of metadata to the tuple.
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).
|
virtual |
Function adding metadata to the D3PD. Not implemented here!
Implements D3PD::ID3PD.
Definition at line 107 of file RootReaderD3PDBase.cxx.
|
protected |
Function adding STL include statements to the header when needed.
This function is used internally to decide if specific STL headers are needed for the generated code or not.
The code just checks if the header name appears in the variable types somewhere, and if it does, it adds the requested header.
out | Output stream where the include statement has to be written |
name | Name of the STL header that the code should process |
Definition at line 167 of file RootReaderD3PDBase.cxx.
|
virtual |
Main function for adding a variable to the D3PD.
Implements D3PD::IAddVariable.
Definition at line 85 of file RootReaderD3PDBase.cxx.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
defval | Pointer 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
.
|
inherited |
Add a variable to the tuple.
name | The name of the variable. |
ptr | Pointer to the type of the variable. The pointer need not be initialized; the D3PD software will set the pointer prior to calling fill() . |
docstring | Documentation string for this variable. |
If called from the constructor, the only effect is to clear ptr
.
|
virtual |
Function capturing the current value of the D3PD variables. Not implemented here!
Implements D3PD::ID3PD.
Definition at line 116 of file RootReaderD3PDBase.cxx.
|
virtual |
Function clearing the D3PD variables. Not implemented here!
Implements D3PD::ID3PD.
Definition at line 123 of file RootReaderD3PDBase.cxx.
|
pure virtualinherited |
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.
classname | Name of the class to be generated |
dir | Directory where the source(s) should be put |
prefix | Common prefix to the declared variables |
Implemented in D3PD::RootReaderD3PD_v1, and D3PD::RootReaderD3PD_v2.
|
virtual |
Get the "isCollection" parameter of the object.
Implements D3PD::IReaderD3PD.
Definition at line 143 of file RootReaderD3PDBase.cxx.
|
virtual |
Get the common prefix of the variables.
Implements D3PD::IReaderD3PD.
Definition at line 154 of file RootReaderD3PDBase.cxx.
Function currently not used by the D3PDMaker code.
Implements D3PD::ID3PD.
Definition at line 130 of file RootReaderD3PDBase.cxx.
|
virtual |
Set the "isCollection" parameter of the object.
Implements D3PD::IReaderD3PD.
Definition at line 137 of file RootReaderD3PDBase.cxx.
|
virtual |
Set the common prefix of the variables.
Implements D3PD::IReaderD3PD.
Definition at line 148 of file RootReaderD3PDBase.cxx.
|
protected |
Object holding the information about the variables.
Definition at line 84 of file RootReaderD3PDBase.h.