#include <TAPGeneratorFactory.h>
Public Types | |
typedef TVAnalysedPulseGenerator *(* | ModuleMaker )(TAPGeneratorOptions *) |
typedef std::vector< std::string > | ArgumentsVector |
Public Member Functions | |
std::string | GetTAPType (const IDs::source &s) |
std::string | GetTAPType (const IDs::generator &g) |
void | registerModule (const std::string &, ModuleMaker, const std::string &out="") |
Add a ModuleMaker function to the list of makers. | |
virtual TVAnalysedPulseGenerator * | createModule (const std::string &, TAPGeneratorOptions *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, TAPGeneratorOptions *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 TAPGeneratorFactory * | Instance () |
Private Member Functions | |
TAPGeneratorFactory () | |
~TAPGeneratorFactory () |
Definition at line 10 of file TAPGeneratorFactory.h.
typedef std::vector<std::string> TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::ArgumentsVector [inherited] |
Definition at line 18 of file TemplateFactory.h.
typedef TVAnalysedPulseGenerator *(* TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::ModuleMaker)(TAPGeneratorOptions *) [inherited] |
Definition at line 17 of file TemplateFactory.h.
TAPGeneratorFactory::TAPGeneratorFactory | ( | ) | [inline, private] |
Definition at line 12 of file TAPGeneratorFactory.h.
Referenced by Instance().
00012 : 00013 TemplateFactory<TVAnalysedPulseGenerator,TAPGeneratorOptions>("TAPGeneratorFactory"){}; ~TAPGeneratorFactory(){};
TAPGeneratorFactory::~TAPGeneratorFactory | ( | ) | [inline, private] |
Definition at line 14 of file TAPGeneratorFactory.h.
void TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::addArgument | ( | const std::string & | argument | ) | [inherited] |
void TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::addArgument | ( | const std::string & | module, | |
const std::string & | argument | |||
) | [inherited] |
void TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::addArguments | ( | const std::string & | all_args | ) | [inherited] |
void TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::addOptions | ( | const std::string & | name, | |
TAPGeneratorOptions * | opts | |||
) | [inherited] |
bool TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::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.
00044 {return (bool) fModules.count(name);};
virtual TVAnalysedPulseGenerator * TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::createModule | ( | const std::string & | , | |
TAPGeneratorOptions * | opts = NULL | |||
) | [virtual, inherited] |
Create a module with options.
std::string TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::GetArgumentName | ( | const std::string & | module, | |
const int & | argument | |||
) | [inherited] |
std::string TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::GetProduct | ( | const std::string & | module | ) | [inherited] |
Referenced by GetTAPType().
std::string TAPGeneratorFactory::GetTAPType | ( | const IDs::generator & | g | ) | [inline] |
Definition at line 22 of file TAPGeneratorFactory.h.
References TemplateFactory< TVAnalysedPulseGenerator, TAPGeneratorOptions >::GetProduct(), and IDs::generator::Type().
00022 { 00023 std::string gen=g.Type(); 00024 size_t n_subtract=gen.find("APGenerator"); 00025 if(n_subtract!=std::string::npos) 00026 gen.erase(n_subtract); //remove APGenerator part 00027 return GetProduct(gen); 00028 }
std::string TAPGeneratorFactory::GetTAPType | ( | const IDs::source & | s | ) | [inline] |
Definition at line 18 of file TAPGeneratorFactory.h.
References IDs::source::Generator().
Referenced by SavePulses::BeforeFirstEntry().
00018 { 00019 return GetTAPType(s.Generator()); 00020 }
TAPGeneratorFactory * TAPGeneratorFactory::Instance | ( | ) | [inline, static] |
Definition at line 34 of file TAPGeneratorFactory.h.
References TAPGeneratorFactory().
Referenced by TAPGeneratorOptions::AddArgument(), MakeAnalysedPulses::AddGenerator(), and SavePulses::BeforeFirstEntry().
00034 { 00035 static TAPGeneratorFactory* instance=NULL; 00036 if(!instance) { 00037 instance=new TAPGeneratorFactory(); 00038 } 00039 return instance; 00040 }
void TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::PrintPossibleModules | ( | ) | const [inherited] |
void TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::registerModule | ( | const std::string & | , | |
ModuleMaker | , | |||
const std::string & | out = "" | |||
) | [inherited] |
Add a ModuleMaker function to the list of makers.
void TemplateFactory< TVAnalysedPulseGenerator , TAPGeneratorOptions >::SetDebug | ( | bool | debug = true |
) | [inline, inherited] |
Definition at line 53 of file TemplateFactory.h.
00053 {fDebug=debug;};