UnCoVer (Using Coverability for Verification)
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
ScenarioLoader.h
1 /***************************************************************************
2  * Copyright (C) 2014 by Jan Stückrath <jan.stueckrath@uni-due.de> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program; if not, write to the *
16  * Free Software Foundation, Inc., *
17  * 51 Franklin St, Fifth Floor, Boston, MA 02110, USA *
18  ***************************************************************************/
19 
20 #ifndef SCENARIOLOADER_H_
21 #define SCENARIOLOADER_H_
22 
23 #include "../basic_types/Scenario.h"
24 #include <ostream>
25 
26 namespace uncover {
27  namespace scenarios {
28 
35 
36  public:
37 
42 
46  virtual ~ScenarioLoader();
47 
54  basic_types::Scenario_up getScenario(string ident) const;
55 
63 
70  basic_types::Scenario_up getScenarioByID(unsigned int id) const;
71 
77  void getScenarioList(std::ostream& ost, string separator = ",") const;
78 
79  private:
80 
84  void initNameToIDMapping ();
85 
89  unordered_map<string,unsigned int> scnNameToIDMapping;
90 
94  unordered_set<string> firstNames;
95 
96  };
97 
98  }
99 } /* namespace loader */
100 
101 #endif /* SCENARIOLOADER_H_ */
virtual ~ScenarioLoader()
Destroys this instance of ScenarioLoader.
Definition: ScenarioLoader.cpp:44
basic_types::Scenario_up getScenarioByID(unsigned int id) const
Generates a Scenario object specified by the given ID without initializing it.
Definition: ScenarioLoader.cpp:68
basic_types::Scenario_up getScenarioByName(string name) const
Generates a Scenario object specified by the given name without initializing it.
Definition: ScenarioLoader.cpp:61
unordered_set< string > firstNames
A set storing all names which should be displayed first when printing the scenario list...
Definition: ScenarioLoader.h:94
basic_types::Scenario_up getScenario(string ident) const
Generates a Scenario object specified by the given string without initializing it.
Definition: ScenarioLoader.cpp:46
unique_ptr< Scenario > Scenario_up
Alias of a unique pointer to a Scenario object.
Definition: Scenario.h:163
unordered_map< string, unsigned int > scnNameToIDMapping
A mapping from scenario names (long and short) to an unique identifier.
Definition: ScenarioLoader.h:89
void initNameToIDMapping()
Fills the scnNameToIDMapping with the appropriate (hard coded) values.
Definition: ScenarioLoader.cpp:93
ScenarioLoader()
Generates a new ScenarioLoader object.
Definition: ScenarioLoader.cpp:40
This class generates Scenario object from their string identifier (without initializing them)...
Definition: ScenarioLoader.h:34
void getScenarioList(std::ostream &ost, string separator=",") const
Print a list of all available scenarios to the given stream using the given separator.
Definition: ScenarioLoader.cpp:131