ATLAS Offline Software
Classes | Namespaces | Macros
RingerIOVarDepObj.h File Reference
#include <string>
#include <TFile.h>
#include "RingerSelectorTools/RingerSelectorToolsDefs.h"
#include "RingerSelectorTools/procedures/IRingerProcedure.h"
#include "RingerSelectorTools/tools/VariableDependency.h"
#include "RingerIOVarDepObj.icc"
Include dependency graph for RingerIOVarDepObj.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Ringer::RingerIOVarDepObj< CRTP >
 Objects that can be recorded/read into/from configuration files. More...
 

Namespaces

 Ringer
 Namespace dedicated for Ringer utilities.
 

Macros

#define RINGER_IO_VARDEP_BASE(self)
 Create RingerIOVarDepObj base object prototype methods. More...
 
#define RINGER_IO_VARDEP_BASE_NOMEMBER(self)
 Same as RINGER_IO_VARDEP_BASE, but when class has no member. More...
 
#define RINGER_IO_VARDEP_OBJ(self, base)
 Add necessary information to RingerIOVarDepObj. More...
 

Macro Definition Documentation

◆ RINGER_IO_VARDEP_BASE

#define RINGER_IO_VARDEP_BASE (   self)
Value:
public: \
\
static void read(self *newObj, \
TDirectory *configDir, \
unsigned version ); \
\
virtual void write(TDirectory *configDir, const char* idxStr = "") \
const override;

Create RingerIOVarDepObj base object prototype methods.

Every time you create a class that use this mechanism, make sure to add it to "RingerSelectorTools/procedures/Types.h"

When you create a class that implements a RingerProcedure and it will be a writable object, then this object must have defined this macro and implement the read and write methods as:

file NewProcedure.h: /code class NewProcedure: virtual public IDiscriminator // or virtual public IPreProcessor // or virtual public IThreshold { // Given as example float m_var;

RINGER_IO_VARDEP_BASE( NewProcedure ) // ... }

RINGER_DEFINE_PROCTYPE_MEMBER_FCN( NewProcedure )

} // namespace Ringer /endcode

file NewProcedure.cxx /code namespace Ringer {

void NewProcedure::read(NewProcedure* newObj, TDirectory *configDir, unsigned version ) { IOHelperFcns::readVar( configDir, "var", newObj->m_var ); }

void NewProcedure::write(TDirectory *configDir) const { IOHelperFcns::writeVar(configDir, "var", m_var ); }

void NewProcedure::print(MSG::Level lvl) const { if ( !this->isStreamAvailable() ) { std::cerr << "Cannot print NewProcedure, stream unavailable" << std::endl; } if ( this->level() > lvl ) { return; } msg() << lvl << this->name() << " configuration:" << endmsg; msg() << lvl << "var:" << m_var << endmsg; }

} // namespace Ringer /endcode

If the procedure has no variable, it can use the RINGER_IO_VARDEP_BASE_NOMEMBER macro instead.

The previous structure will need also to implement the VariableDependency class, which will inherit from the RingerIOVarDepObj using the RINGER_IO_VARDEP_OBJ macro described next.

/code class NewProcedureVarDep : virtual public IDiscriminatorVarDep, public RingerIOVarDepObj<NewProcedureVarDep>, public NewProcedure { RINGER_IO_VARDEP_OBJ(NewProcedureVarDep, NewProcedure) // ... } /endcode

Definition at line 99 of file RingerIOVarDepObj.h.

◆ RINGER_IO_VARDEP_BASE_NOMEMBER

#define RINGER_IO_VARDEP_BASE_NOMEMBER (   self)
Value:
public: \
\
static void read(self *, \
TDirectory *, \
unsigned ) {;} \
\
virtual void write(TDirectory *, const char*) const \
override {;}

Same as RINGER_IO_VARDEP_BASE, but when class has no member.

Definition at line 114 of file RingerIOVarDepObj.h.

◆ RINGER_IO_VARDEP_OBJ

#define RINGER_IO_VARDEP_OBJ (   self,
  base 
)

Add necessary information to RingerIOVarDepObj.

When declaring the new procedure variable dependent object, you will need to add this macro adding to add its base type where you used the RINGER_IO_VARDEP_BASE macro.

Definition at line 135 of file RingerIOVarDepObj.h.

read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
python.ByteStreamConfig.write
def write
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:248
RINGER_DEFINE_NOMEMBER_PROCEDURE
#define RINGER_DEFINE_NOMEMBER_PROCEDURE(self)
Use this macro when procedure hasn't member properties.
Definition: IRingerProcedure.h:91
RINGER_DEFINE_PROCEDURE
#define RINGER_DEFINE_PROCEDURE(self)
Use this macro when procedure has member properties.
Definition: IRingerProcedure.h:80
get_generator_info.version
version
Definition: get_generator_info.py:33