#include <ModulesFactory.h>
Public Types | |
typedef modules::BaseModule *(* | ModuleMaker )(modules::options *) |
typedef std::vector< std::string > | ArgumentsVector |
Public Member Functions | |
void | registerModule (const std::string &, ModuleMaker, const std::string &out="") |
Add a ModuleMaker function to the list of makers. | |
virtual modules::BaseModule * | createModule (const std::string &, modules::options *opts=NULL) |
Create a module with options. | |
bool | canCreate (const std::string &name) const |
Check if a module with this name has been registered. | |
void | addOptions (const std::string &name, modules::options *opts) |
void | addArguments (const std::string &all_args) |
void | addArgument (const std::string &module, const std::string &argument) |
void | addArgument (const std::string &argument) |
std::string | GetArgumentName (const std::string &module, const int &argument) |
std::string | GetProduct (const std::string &module) |
void | SetDebug (bool debug=true) |
void | PrintPossibleModules () const |
Static Public Member Functions | |
static factory * | Instance () |
Private Member Functions | |
factory () | |
~factory () |
Definition at line 14 of file ModulesFactory.h.
typedef std::vector<std::string> TemplateFactory< modules::BaseModule , modules::options >::ArgumentsVector [inherited] |
Definition at line 18 of file TemplateFactory.h.
typedef modules::BaseModule *(* TemplateFactory< modules::BaseModule , modules::options >::ModuleMaker)(modules::options *) [inherited] |
Definition at line 17 of file TemplateFactory.h.
modules::factory::factory | ( | ) | [inline, private] |
Definition at line 16 of file ModulesFactory.h.
Referenced by Instance().
00016 :TemplateFactory<modules::BaseModule,modules::options>("modules::factory"){};
modules::factory::~factory | ( | ) | [inline, private] |
Definition at line 17 of file ModulesFactory.h.
void TemplateFactory< modules::BaseModule , modules::options >::addArgument | ( | const std::string & | argument | ) | [inherited] |
void TemplateFactory< modules::BaseModule , modules::options >::addArgument | ( | const std::string & | module, | |
const std::string & | argument | |||
) | [inherited] |
void TemplateFactory< modules::BaseModule , modules::options >::addArguments | ( | const std::string & | all_args | ) | [inherited] |
void TemplateFactory< modules::BaseModule , modules::options >::addOptions | ( | const std::string & | name, | |
modules::options * | opts | |||
) | [inherited] |
bool TemplateFactory< modules::BaseModule , modules::options >::canCreate | ( | const std::string & | name | ) | const [inline, inherited] |
Check if a module with this name has been registered.
Definition at line 44 of file TemplateFactory.h.
References TemplateFactory< BaseModule, OptionsType >::fModules.
00044 {return (bool) fModules.count(name);};
virtual modules::BaseModule * TemplateFactory< modules::BaseModule , modules::options >::createModule | ( | const std::string & | , | |
modules::options * | opts = NULL | |||
) | [virtual, inherited] |
Create a module with options.
std::string TemplateFactory< modules::BaseModule , modules::options >::GetArgumentName | ( | const std::string & | module, | |
const int & | argument | |||
) | [inherited] |
std::string TemplateFactory< modules::BaseModule , modules::options >::GetProduct | ( | const std::string & | module | ) | [inherited] |
modules::factory * modules::factory::Instance | ( | ) | [inline, static] |
Definition at line 24 of file ModulesFactory.h.
References factory().
Referenced by modules::options::AddArgument(), load_config_file(), modules::reader::ProcessGlobalOption(), and modules::reader::SetDebug().
00024 { 00025 static modules::factory* instance=NULL; 00026 if(!instance) { 00027 instance=new factory(); 00028 } 00029 return instance; 00030 }
void TemplateFactory< modules::BaseModule , modules::options >::PrintPossibleModules | ( | ) | const [inherited] |
void TemplateFactory< modules::BaseModule , modules::options >::registerModule | ( | const std::string & | , | |
ModuleMaker | , | |||
const std::string & | out = "" | |||
) | [inherited] |
Add a ModuleMaker function to the list of makers.
void TemplateFactory< modules::BaseModule , modules::options >::SetDebug | ( | bool | debug = true |
) | [inline, inherited] |
Definition at line 53 of file TemplateFactory.h.
References TemplateFactory< BaseModule, OptionsType >::fDebug.
00053 {fDebug=debug;};