24 using namespace genie;
90 <<
"Algorithm: " << key <<
" requested from AlgFactory";
96 LOG(
"AlgFactory",
pDEBUG) << key <<
" algorithm found in memory";
97 return alg_iter->second;
104 pair<string, Algorithm *> key_alg_pair(key, alg_base);
108 <<
"Algorithm: " << key <<
" could not be instantiated";
134 <<
" ** Forcing algorithm re-configuration";
137 for( ; alg_iter !=
fAlgPool.end(); ++alg_iter) {
139 bool reconfig = (ignore_alg_opt_out) ?
true : alg->
AllowReconfig();
142 bool skip_conf = (config==
"NoConfig" || config==
"");
158 LOG(
"AlgFactory",
pDEBUG) <<
"Instantiating algorithm = " <<
name;
160 TClass * tclass = gROOT->GetClass(name.c_str());
163 <<
"Failed instantiating algorithm = " <<
name;
166 void * vd_base = tclass->New();
173 bool skip_conf = (config==
"NoConfig" || config==
"");
175 LOG(
"AlgFactory",
pDEBUG) <<
"Skipping algorithm configuration step!";
185 string frame(100,
'.');
190 const Algorithm * alg = alg_iter->second;
191 stream << frame <<
endl;
192 stream <<
"Used algorithm: " << alg->
Id() <<
endl;
193 stream <<
"Printing config:";
200 stream << frame <<
endl;
201 stream <<
"Printing global parameters list:";
void Print(ostream &stream) const
print algorithm factory
THE MAIN GENIE PROJECT NAMESPACE
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
void DummyMethodAndSilentCompiler()
Algorithm abstract base class.
virtual const Registry & GetConfig(void) const
static AlgFactory * fInstance
sinleton's self
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void ForceReconfiguration(bool ignore_alg_opt_out=false)
virtual void Configure(const Registry &config)
const Algorithm * GetAlgorithm(const AlgId &algid)
Algorithm * AdoptAlgorithm(const AlgId &algid) const
Registry * GlobalParameterList(void) const
Algorithm * InstantiateAlgorithm(string name, string config) const
Algorithm ID (algorithm name + configuration set name)
virtual const AlgId & Id(void) const
Get algorithm ID.
static AlgFactory * Instance()
virtual bool AllowReconfig(void) const
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
A registry. Provides the container for algorithm configuration parameters.
The GENIE Algorithm Factory.
map< string, Algorithm * > fAlgPool
'algorithm key' (namespace::name/config) -> 'algorithmic object' map
#define SLOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a short string (using the FUNCTION and...
QTextStream & endl(QTextStream &s)
static AlgConfigPool * Instance()
string Config(void) const