libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
solutiondata.h
1 #ifndef SOLUTIONDATA_H
2 #define SOLUTIONDATA_H
3 
4 #include <string>
5 #include <map>
6 #include <jsoncpp/json/value.h>
7 #include "Logging/Logger.h"
8 
9 
10 
11 
20 {
21  MOVE3D_STATIC_LOGGER;
22 public:
23  SolutionData();
25  ~SolutionData();
26 
32 
33 
34 
38  const std::map<std::string, int> &getIntMap();
39 
43  const std::map<std::string, double> &getDoubleMap();
44 
48  const std::map<std::string, std::string> &getStringMap();
49 
53  const std::map<std::string, SolutionData*> &getSDMap();
54 
55 
56 
61  std::multimap<std::string, std::string> getStringAsMultimapMap();
62 
63 
64 
69  void setMapEntry(std::string key, int val);
70 
71 
76  void setMapEntry(std::string key, double val);
77 
82  void setMapEntry(std::string key, std::string val);
83 
88  void setMapEntry(std::string key, SolutionData* val);
89 
90 
91 
96  void incrementMapEntry(std::string key);
97 
103  void incrementMapEntry(std::string key,int val);
104 
105 
106 
111  int getIntMapEntry(std::string key);
112 
117  double getDoubleMapEntry(std::string key);
118 
123  std::string getStringMapEntry(std::string key);
124 
129  SolutionData* getSDMapEntry(std::string key);
130 
131 
132 
137  std::string getHumanReadableData();
138 
142  void print();
143 
148  Json::Value getJsonValue();
149 
154  void loadFromJsonValue(Json::Value root);
155 
156 
157 
161  std::string getSpace();
162 
166  void setSpace(std::string s);
167 
168 
169 
173  int getSize();
174 
178  void setSize(int s);
179 
180 
184  void clear();
185 
186 private:
187 
191  std::map<std::string, int> _intMap;
192 
196  std::map<std::string, double> _doubleMap;
197 
201  std::map<std::string, std::string> _stringMap;
202 
206  std::map<std::string, SolutionData*> _SDMap;
207 
208 
220  std::string _space;
221 
228  int _size;
229 
230 
231 };
232 
233 #endif // SOLUTIONDATA_H
const std::map< std::string, double > & getDoubleMap()
Definition: solutiondata.cpp:45
void clear()
clean all the maps.
Definition: solutiondata.cpp:242
const std::map< std::string, int > & getIntMap()
Definition: solutiondata.cpp:40
void copySolutionData(SolutionData *SD)
copy the data of a solutionData pointer into this one
Definition: solutiondata.cpp:24
void print()
Call getHumanReadableData() and print the return value.
Definition: solutiondata.cpp:179
std::string getHumanReadableData()
Transform the data into human readable strings.
Definition: solutiondata.cpp:132
std::string getSpace()
Definition: solutiondata.cpp:222
void loadFromJsonValue(Json::Value root)
Fill the maps with data retrived from root, a json value.
Definition: solutiondata.cpp:207
Json::Value getJsonValue()
Transform the data into json.
Definition: solutiondata.cpp:184
This file implements macros to help with the logging, in a way similar to ROS, using log4cxx...
SolutionData * getSDMapEntry(std::string key)
Definition: solutiondata.cpp:123
const std::map< std::string, SolutionData * > & getSDMap()
Definition: solutiondata.cpp:55
std::string getStringMapEntry(std::string key)
Definition: solutiondata.cpp:118
double getDoubleMapEntry(std::string key)
Definition: solutiondata.cpp:113
void setSpace(std::string s)
Set the space to leave for this specific map when creating a human readable string.
Definition: solutiondata.cpp:227
void setSize(int s)
Definition: solutiondata.cpp:237
int getSize()
Definition: solutiondata.cpp:232
std::multimap< std::string, std::string > getStringAsMultimapMap()
transform the string map into a multimap of strings
Definition: solutiondata.cpp:60
int getIntMapEntry(std::string key)
Definition: solutiondata.cpp:108
void incrementMapEntry(std::string key)
search in the int (first) and the double maps the key param and if found increment by 1 its value...
Definition: solutiondata.cpp:88
Info storage class.
Definition: solutiondata.h:19
void setMapEntry(std::string key, int val)
Definition: solutiondata.cpp:68
const std::map< std::string, std::string > & getStringMap()
Definition: solutiondata.cpp:50