GENIEGenerator
Loading...
Searching...
No Matches
gtestConfigPool.cxx File Reference
Include dependency graph for gtestConfigPool.cxx:

Go to the source code of this file.

Functions

int main (int, char **)

Function Documentation

◆ main()

int main ( int ,
char **  )

Definition at line 28 of file gtestConfigPool.cxx.

29{
30 // Get an instance of the ConfigPool
31 LOG("test", pINFO) << "Get config pool instance";
33
34 // Print the ConfigPool ( => print all its configuration registries )
35 LOG("test", pINFO) << "Printing the config pool\n" << *pool;
36
37 // Get the algorithm factory
39
40 // Instantiate an algorithm
41 LOG("test", pINFO) << "Instantiate a concrete algorithm";
42 const Algorithm * alg0 =
43 algf->GetAlgorithm("genie::LwlynSmithFFCC","Default");
44 const QELFormFactorsModelI * llewellyn_smith =
45 dynamic_cast<const QELFormFactorsModelI *> (alg0);
46 LOG("test", pINFO) << *alg0;
47
48 LOG("test", pINFO) << "Instantiate another concrete algorithm";
49 const Algorithm * alg1 =
50 algf->GetAlgorithm("genie::DipoleELFormFactorsModel","Default");
51 const ELFormFactorsModelI * dipole_elff =
52 dynamic_cast<const ELFormFactorsModelI *> (alg1);
53 LOG("test", pINFO) << *alg1;
54
55 // Ask the ConfigPool for this algorithm's config registry and print it
56
57 LOG("test", pINFO) << "Find the configuration for both algorithms";
58
59 Registry * config1 = pool->FindRegistry( llewellyn_smith );
60 Registry * config2 = pool->FindRegistry( dipole_elff );
61
62 if(config1) LOG("test", pINFO) << "1st algorithm config: \n" << *config1;
63 if(config2) LOG("test", pINFO) << "2nd algorithm config: \n" << *config2;
64
65 return 0;
66}
#define pINFO
Definition Messenger.h:62
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Registry * FindRegistry(string key) const
static AlgConfigPool * Instance()
The GENIE Algorithm Factory.
Definition AlgFactory.h:39
const Algorithm * GetAlgorithm(const AlgId &algid)
static AlgFactory * Instance()
Algorithm abstract base class.
Definition Algorithm.h:54
Pure abstract base class. Defines the ELFormFactorsModelI interface to be implemented by any algorith...
Pure abstract base class. Defines the QELFormFactorsModelI interface to be implemented by any algorit...
A registry. Provides the container for algorithm configuration parameters.
Definition Registry.h:65

References genie::AlgConfigPool::FindRegistry(), genie::AlgFactory::GetAlgorithm(), genie::AlgConfigPool::Instance(), genie::AlgFactory::Instance(), LOG, and pINFO.