GGS(GenericGEANT4Simulation)Software  2.7.0
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
GGSVGeometryConstruction.cpp
1 /*
2  * GGSVGeometryConstruction.cpp
3  *
4  * Created on: 27 dic 2017
5  * Author: Nicola Mori
6  */
7 
11 
12 #include <utility>
13 
14 const std::map<std::string, int> &GGSVGeometryConstruction::GetIntParameters() { return _intParams; }
15 
16 const std::map<std::string, bool> &GGSVGeometryConstruction::GetBoolParameters() { return _boolParams; }
17 
18 const std::map<std::string, double> &GGSVGeometryConstruction::GetRealParameters() { return _realParams; }
19 
20 const std::map<std::string, std::string> &GGSVGeometryConstruction::GetStringParameters() { return _stringParams; }
21 
22 const std::map<std::string, std::vector<int>> &GGSVGeometryConstruction::GetVectIntParameters() {
23  return _vectIntParams;
24 }
25 
26 const std::map<std::string, std::vector<bool>> &GGSVGeometryConstruction::GetVectBoolParameters() {
27  return _vectBoolParams;
28 }
29 
30 const std::map<std::string, std::vector<double>> &GGSVGeometryConstruction::GetVectRealParameters() {
31  return _vectRealParams;
32 }
33 
34 const std::map<std::string, std::vector<std::string>> &GGSVGeometryConstruction::GetVectStringParameters() {
35  return _vectStringParams;
36 }
37 
38 bool GGSVGeometryConstruction::ExportIntParameter(std::string name, int value) {
39  if (!_intParams.insert(std::make_pair(name, value)).second)
40  throw std::runtime_error("Cannot export int parameter \"" + name + "\"");
41  return true;
42 }
43 
44 bool GGSVGeometryConstruction::ExportBoolParameter(std::string name, bool value) {
45  if (!_boolParams.insert(std::make_pair(name, value)).second)
46  throw std::runtime_error("Cannot export bool parameter \"" + name + "\"");
47  return true;
48 }
49 
50 bool GGSVGeometryConstruction::ExportRealParameter(std::string name, double value) {
51  if (!_realParams.insert(std::make_pair(name, value)).second)
52  throw std::runtime_error("Cannot export real parameter \"" + name + "\"");
53  return true;
54 }
55 bool GGSVGeometryConstruction::ExportStringParameter(std::string name, std::string value) {
56  if (!_stringParams.insert(std::make_pair(name, value)).second)
57  throw std::runtime_error("Cannot export string parameter \"" + name + "\"");
58  return true;
59 }
60 
61 bool GGSVGeometryConstruction::ExportVectIntParameter(std::string name, std::vector<int> value) {
62  if (!_vectIntParams.insert(std::make_pair(name, std::move(value))).second)
63  throw std::runtime_error("Cannot export vector-of-int parameter \"" + name + "\"");
64  return true;
65 }
66 
67 bool GGSVGeometryConstruction::ExportVectBoolParameter(std::string name, std::vector<bool> value) {
68  if (!_vectBoolParams.insert(std::make_pair(name, std::move(value))).second)
69  throw std::runtime_error("Cannot export vector-of-bool parameter \"" + name + "\"");
70  return true;
71 }
72 
73 bool GGSVGeometryConstruction::ExportVectRealParameter(std::string name, std::vector<double> value) {
74  if (!_vectRealParams.insert(std::make_pair(name, std::move(value))).second)
75  throw std::runtime_error("Cannot export vector-of-real parameter \"" + name + "\"");
76  return true;
77 }
78 bool GGSVGeometryConstruction::ExportVectStringParameter(std::string name, std::vector<std::string> value) {
79  if (!_vectStringParams.insert(std::make_pair(name, std::move(value))).second)
80  throw std::runtime_error("Cannot export vector-of-string parameter \"" + name + "\"");
81  return true;
82 }
bool ExportBoolParameter(std::string name, bool value)
Sets the value of a boolean parameter.
const std::map< std::string, std::vector< bool > > & GetVectBoolParameters()
Getter method for vector-of-booleans geometry parameters.
const std::map< std::string, int > & GetIntParameters()
Getter method for integer geometry parameters.
const std::map< std::string, double > & GetRealParameters()
Getter method for real geometry parameters.
const std::map< std::string, std::vector< std::string > > & GetVectStringParameters()
Getter method for vector-of-strings geometry parameters.
bool ExportRealParameter(std::string name, double value)
Sets the value of a real parameter.
const std::map< std::string, std::vector< int > > & GetVectIntParameters()
Getter method for vector-of-integers geometry parameters.
const std::map< std::string, std::string > & GetStringParameters()
Getter method for string geometry parameters.
bool ExportVectBoolParameter(std::string name, std::vector< bool > value)
Sets the value of a vector-of-booleans parameter.
const std::map< std::string, std::vector< double > > & GetVectRealParameters()
Getter method for vector-of-reals geometry parameters.
bool ExportVectRealParameter(std::string name, std::vector< double > value)
Sets the value of a vector-of-reals parameter.
const std::map< std::string, bool > & GetBoolParameters()
Getter method for boolean geometry parameters.
bool ExportStringParameter(std::string name, std::string value)
Sets the value of a string parameter.
bool ExportIntParameter(std::string name, int value)
Sets the value of an integer parameter.
bool ExportVectIntParameter(std::string name, std::vector< int > value)
Sets the value of a vector-of-integers parameter.
bool ExportVectStringParameter(std::string name, std::vector< std::string > value)
Sets the value of a vector-of-strings parameter.