Mania++
 All Classes Functions Variables Pages
GbxParameters.h
1 #ifndef GBXPARAMETERS_H_
2 #define GBXPARAMETERS_H_
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 #include <typeinfo>
8 
9 //* GbxParam
13 struct GbxParam
14 {
15  void* pointer;
16  const std::type_info* typeinfo;
17 };
18 
19 //* GbxStructParameters
24 {
25 public:
31  void Put(std::string text)
32  {
33  parameters.push_back(text);
34  }
35 
39  std::vector<std::string> GetParameters()
40  {
41  return parameters;
42  }
43 
44 private:
45  std::vector<std::string> parameters = std::vector<std::string>();
46 };
47 
48 //* GbxParameters
53 {
54 public:
60  template<typename T>
61  void Put(T* pointer)
62  {
63  GbxParam paramStruct = { pointer, &typeid(T) };
64  parameters.push_back(paramStruct);
65  }
66 
70  std::vector<GbxParam> GetParameters()
71  {
72  return parameters;
73  }
74 
75 private:
76  std::vector<GbxParam> parameters = std::vector<GbxParam>();
77 };
78 
79 #endif // GBXPARAMETERS_H_
List of parameters.
Definition: GbxParameters.h:52
std::vector< std::string > parameters
List of parameters.
Definition: GbxParameters.h:45
void * pointer
Pointer to the parameter.
Definition: GbxParameters.h:15
std::vector< std::string > GetParameters()
Return the current list of parameters.
Definition: GbxParameters.h:39
List of struct parameters.
Definition: GbxParameters.h:23
std::vector< GbxParam > GetParameters()
Return the current list of parameters.
Definition: GbxParameters.h:70
std::vector< GbxParam > parameters
List of parameters.
Definition: GbxParameters.h:76
const std::type_info * typeinfo
Type information of the parameter.
Definition: GbxParameters.h:16
void Put(std::string text)
Add parameter to the list.
Definition: GbxParameters.h:31
Pointer and type information of a parameter.
Definition: GbxParameters.h:13
void Put(T *pointer)
Add parameter to the list.
Definition: GbxParameters.h:61