Mania++
 All Classes Functions Variables Pages
GbxParameters.h
1 #ifndef GBXPARAMETERS_H_
2 #define GBXPARAMETERS_H_
3 
4 #include <sstream>
5 #include <string>
6 #include <vector>
7 #include <map>
8 #include <typeinfo>
9 
10 #include "../../Utils/Parameter.h"
11 
12 //* GbxStructParameters
17 {
18 public:
24  void Put(std::string text)
25  {
26  parameters.push_back(text);
27  }
28 
35  void Put(std::string methodName, std::string parameter)
36  {
37  std::stringstream parameterStream;
38  parameterStream << "<member><name>" << methodName << "</name><value>" << parameter << "</value></member>";
39  parameters.push_back(parameterStream.str());
40  }
41 
48  void Put(std::string methodName, Parameter parameter);
49 
53  std::vector<std::string> GetParameters()
54  {
55  return parameters;
56  }
57 
58 private:
59  std::vector<std::string> parameters = std::vector<std::string>();
60 };
61 
62 //* GbxParameters
67 {
68 public:
74  template<typename T>
75  void Put(T* pointer)
76  {
77  Parameter paramStruct = { pointer, &typeid(T) };
78  parameters.push_back(paramStruct);
79  }
80 
84  std::vector<Parameter> GetParameters()
85  {
86  return parameters;
87  }
88 
89 private:
90  std::vector<Parameter> parameters = std::vector<Parameter>();
91 };
92 
93 #endif // GBXPARAMETERS_H_
List of parameters.
Definition: GbxParameters.h:66
std::vector< std::string > parameters
List of parameters.
Definition: GbxParameters.h:59
std::vector< Parameter > parameters
List of parameters.
Definition: GbxParameters.h:90
std::vector< std::string > GetParameters()
Return the current list of parameters.
Definition: GbxParameters.h:53
List of struct parameters.
Definition: GbxParameters.h:16
void Put(std::string methodName, std::string parameter)
Add parameter to the list.
Definition: GbxParameters.h:35
void Put(std::string text)
Add parameter to the list.
Definition: GbxParameters.h:24
std::vector< Parameter > GetParameters()
Return the current list of parameters.
Definition: GbxParameters.h:84
Pointer and type information of a parameter.
Definition: Parameter.h:11
void Put(T *pointer)
Add parameter to the list.
Definition: GbxParameters.h:75