#include <EvtModel.hh>
Public Member Functions | |
EvtDecayBase * | getFcn (std::string model_name) |
int | isCommand (std::string cmd) |
int | isModel (std::string name) |
void | Register (EvtDecayBase *prototype) |
void | storeCommand (std::string cmd, std::string cnfgstr) |
Static Public Member Functions | |
EvtModel & | instance () |
Private Member Functions | |
EvtModel () | |
Private Attributes | |
std::map< std::string, EvtDecayBase * > | _commandNameHash |
std::map< std::string, EvtDecayBase * > | _modelNameHash |
Static Private Attributes | |
EvtModel * | _instance = 0 |
|
00042 { 00043 00044 }
|
|
00046 { 00047 00048 EvtDecayBase *model=0; 00049 if ( _modelNameHash.find(model_name)!=_modelNameHash.end() ) { 00050 model=_modelNameHash[model_name]; 00051 } 00052 00053 if (model==0){ 00054 report(ERROR,"EvtGen") << "Did not find the right model:" 00055 <<model_name.c_str()<<"\n"; 00056 return 0; 00057 } 00058 00059 return model->clone(); 00060 00061 }
|
|
|
|
00092 { 00093 00094 if ( _commandNameHash.find(cmd)!=_commandNameHash.end() ) { 00095 return 1; 00096 } 00097 return 0; 00098 }
|
|
00083 { 00084 00085 if ( _modelNameHash.find(model_name)!=_modelNameHash.end() ) { 00086 return 1; 00087 } 00088 return 0; 00089 }
|
|
00064 { 00065 00066 std::string modelName; 00067 prototype->getName(modelName); 00068 00069 _modelNameHash[modelName]=prototype; 00070 00071 std::string commandName=prototype->commandName(); 00072 00073 if (commandName!=""){ 00074 00075 //report(DEBUG,"EvtGen") << "Adding command:"<<commandName<<endl; 00076 00077 _commandNameHash[commandName]=prototype; 00078 00079 } 00080 00081 }
|
|
00100 { 00101 00102 EvtDecayBase *model=0; 00103 if ( _commandNameHash.find(cmd)!=_commandNameHash.end() ) { 00104 model=_commandNameHash[cmd]; 00105 } 00106 00107 assert(model!=0); 00108 00109 model->command(cnfgstr); 00110 00111 }
|
|
|
|
|
|
|