ATLAS Offline Software
Loading...
Searching...
No Matches
RingerIOVarDepObj.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef RINGERSELECTORTOOLS_TOOLS_RINGERIOVARDEPOBJ_H
6#define RINGERSELECTORTOOLS_TOOLS_RINGERIOVARDEPOBJ_H
7
8// STL includes:
9#include <string>
10
11// Root includes:
12#include <TFile.h>
13
14// Local includes:
18
97
98#define RINGER_IO_VARDEP_BASE(self) \
99 public: \
100 \
101 RINGER_DEFINE_PROCEDURE(self) \
102 \
103 static void read(self *newObj, \
104 TDirectory *configDir, \
105 unsigned version ); \
106 \
107 virtual void write(TDirectory *configDir, const char* idxStr = "") \
108 const override;
109
113#define RINGER_IO_VARDEP_BASE_NOMEMBER(self) \
114 public: \
115 \
116 RINGER_DEFINE_NOMEMBER_PROCEDURE(self) \
117 \
118 static void read(self *, \
119 TDirectory *, \
120 unsigned ) {;} \
121 \
122 virtual void write(TDirectory *, const char*) const \
123 override {;}
124
134#define RINGER_IO_VARDEP_OBJ(self, base) \
135 \
136 public: \
137 typedef base base_t; \
138 \
139 template <typename T = const char*> \
140 static T procType() \
141 { \
142 return base::template procType<T>(); \
143 } \
144 \
145 virtual std::string name() const \
146 override final \
147 { \
148 return this->RingerIOVarDepObj<self>::name(); \
149 } \
150 \
151 void print(MSG::Level lvl) const \
152 override final \
153 { \
154 this->base_t::print(lvl); \
155 } \
156 \
157 virtual void write(TDirectory *baseDir, const char* idxStr = "") const \
158 override final \
159 { \
160 this->RingerIOVarDepObj<self>::write(baseDir, idxStr); \
161 } \
162 \
163 static self* read(TDirectory *configDir){ \
164 return RingerIOVarDepObj<self>::read(configDir); \
165 } \
166 \
167 typedef typename Ringer::template RingerProcedureType<base>:: \
168 baseInterface_t baseInterface_t; \
169 \
170 using baseInterface_t::procType;
171
172namespace Ringer {
173
193template < class CRTP >
195{
196
197 public:
201 //typedef CRTP crtp_t;
202
203 // Make sure we initialize the variable dependency
205
209 std::string name() const;
210
214 static CRTP* read(TDirectory *configDir);
215
219 void write(TDirectory *baseDir, const char* idxStr="")
220 const;
221};
222
223} // namespace Ringer
224
225#endif // RINGERSELECTORTOOLS_TOOLS_RINGERIOVARDEPOBJ_H
226
227#ifndef INCLUDE_HEADER_ONLY // Use to avoid circular includes
228#include "RingerIOVarDepObj.icc"
229#endif // INCLUDE_HEADER_ONLY
std::string name() const
Retrieve name for this RingerIOVarDepObj.
RingerIOVarDepObj()
Typedef to CRTP type:
static CRTP * read(TDirectory *configDir)
Read Ringer procedure from configuration dir.
void write(TDirectory *baseDir, const char *idxStr="") const
Write Ringer procedure to configuration directory.
VariableDependency()=default
Ctor for independent.
Namespace dedicated for Ringer utilities.