Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EvtModel Class Reference

#include <EvtModel.hh>

List of all members.

Public Member Functions

EvtDecayBasegetFcn (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

EvtModelinstance ()

Private Member Functions

 EvtModel ()

Private Attributes

std::map< std::string, EvtDecayBase * > _commandNameHash
std::map< std::string, EvtDecayBase * > _modelNameHash

Static Private Attributes

EvtModel_instance = 0


Constructor & Destructor Documentation

EvtModel::EvtModel  )  [private]
 

00042                    {
00043 
00044 }


Member Function Documentation

EvtDecayBase * EvtModel::getFcn std::string  model_name  ) 
 

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 }

EvtModel & EvtModel::instance  )  [inline, static]
 

00063                                     {
00064   if ( _instance == 0 )  _instance=new EvtModel;
00065   return *_instance;
00066 }

int EvtModel::isCommand std::string  cmd  ) 
 

00092                                     {
00093 
00094   if ( _commandNameHash.find(cmd)!=_commandNameHash.end() ) {
00095     return 1;
00096   }
00097   return 0;
00098 }

int EvtModel::isModel std::string  name  ) 
 

00083                                          {
00084 
00085   if ( _modelNameHash.find(model_name)!=_modelNameHash.end() ) {
00086     return 1;
00087   }
00088   return 0;
00089 }

void EvtModel::Register EvtDecayBase prototype  ) 
 

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 }

void EvtModel::storeCommand std::string  cmd,
std::string  cnfgstr
 

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 }


Member Data Documentation

std::map<std::string,EvtDecayBase*> EvtModel::_commandNameHash [private]
 

EvtModel * EvtModel::_instance = 0 [static, private]
 

std::map<std::string,EvtDecayBase*> EvtModel::_modelNameHash [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:07:23 2011 for BOSS6.5.5 by  doxygen 1.3.9.1