Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-08-06 09:20:02

0001 
0002 /***********************************************************************
0003 * Copyright 1998-2020 CERN for the benefit of the EvtGen authors       *
0004 *                                                                      *
0005 * This file is part of EvtGen.                                         *
0006 *                                                                      *
0007 * EvtGen is free software: you can redistribute it and/or modify       *
0008 * it under the terms of the GNU General Public License as published by *
0009 * the Free Software Foundation, either version 3 of the License, or    *
0010 * (at your option) any later version.                                  *
0011 *                                                                      *
0012 * EvtGen is distributed in the hope that it will be useful,            *
0013 * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
0014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
0015 * GNU General Public License for more details.                         *
0016 *                                                                      *
0017 * You should have received a copy of the GNU General Public License    *
0018 * along with EvtGen.  If not, see <https://www.gnu.org/licenses/>.     *
0019 ***********************************************************************/
0020 
0021 #include <map>
0022 #include <string>
0023 #include <vector>
0024 
0025 #ifndef EVTEXTGENERATORCOMMANDSTABLE_HH
0026 #define EVTEXTGENERATORCOMMANDSTABLE_HH
0027 
0028 typedef std::map<std::string, std::string> Command;
0029 typedef std::vector<Command> GeneratorCommands;
0030 typedef std::map<std::string, GeneratorCommands> GlobalCommandMap;
0031 
0032 class EvtExtGeneratorCommandsTable {
0033   public:
0034     static EvtExtGeneratorCommandsTable* getInstance();
0035 
0036     void addCommand( std::string extGenerator, Command command )
0037     {
0038         _commandMap[extGenerator].push_back( command );
0039     }
0040     const GeneratorCommands& getCommands( std::string extGenerator )
0041     {
0042         return _commandMap[extGenerator];
0043     }
0044 
0045   protected:
0046     EvtExtGeneratorCommandsTable();
0047     ~EvtExtGeneratorCommandsTable();
0048 
0049   private:
0050     GlobalCommandMap _commandMap;
0051 
0052     EvtExtGeneratorCommandsTable( const EvtExtGeneratorCommandsTable& ){};
0053 };
0054 
0055 #endif