Info storage class.
More...
#include <solutiondata.h>
|
| SolutionData (SolutionData *SD) |
|
void | copySolutionData (SolutionData *SD) |
| copy the data of a solutionData pointer into this one More...
|
|
const std::map< std::string,
int > & | getIntMap () |
|
const std::map< std::string,
double > & | getDoubleMap () |
|
const std::map< std::string,
std::string > & | getStringMap () |
|
const std::map< std::string,
SolutionData * > & | getSDMap () |
|
std::multimap< std::string,
std::string > | getStringAsMultimapMap () |
| transform the string map into a multimap of strings More...
|
|
void | setMapEntry (std::string key, int val) |
|
void | setMapEntry (std::string key, double val) |
|
void | setMapEntry (std::string key, std::string val) |
|
void | setMapEntry (std::string key, SolutionData *val) |
|
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. More...
|
|
void | incrementMapEntry (std::string key, int val) |
| search in the int (first) and the double maps the key param and if found increment by val its value. More...
|
|
int | getIntMapEntry (std::string key) |
|
double | getDoubleMapEntry (std::string key) |
|
std::string | getStringMapEntry (std::string key) |
|
SolutionData * | getSDMapEntry (std::string key) |
|
std::string | getHumanReadableData () |
| Transform the data into human readable strings. More...
|
|
void | print () |
| Call getHumanReadableData() and print the return value.
|
|
Json::Value | getJsonValue () |
| Transform the data into json. More...
|
|
void | loadFromJsonValue (Json::Value root) |
| Fill the maps with data retrived from root, a json value. More...
|
|
std::string | getSpace () |
|
void | setSpace (std::string s) |
| Set the space to leave for this specific map when creating a human readable string.
|
|
int | getSize () |
|
void | setSize (int s) |
|
void | clear () |
| clean all the maps.
|
|
Info storage class.
An instance of SolutionData is used to cache the data retrived during computation (especially of GTP) It stores the data on maps, it has three different basic maps -> int, double, and string maps, and a recursive one of pointers on SolutionData. To save and entry, use setMapEntry, and to retrieve it get<>MapEntry.
copy the data of a solutionData pointer into this one
- Parameters
-
SD | the solution data to copy |
const std::map< std::string, double > & SolutionData::getDoubleMap |
( |
| ) |
|
double SolutionData::getDoubleMapEntry |
( |
std::string |
key | ) |
|
- Parameters
-
key | the key to look for in the double map |
- Returns
- : the value corresponding to the key in the double map.
std::string SolutionData::getHumanReadableData |
( |
| ) |
|
Transform the data into human readable strings.
- Returns
- : a human readable string
const std::map< std::string, int > & SolutionData::getIntMap |
( |
| ) |
|
int SolutionData::getIntMapEntry |
( |
std::string |
key | ) |
|
- Parameters
-
key | the key to look for in the int map |
- Returns
- : the value corresponding to the key in the int map.
Json::Value SolutionData::getJsonValue |
( |
| ) |
|
Transform the data into json.
- Returns
- : a json value containing all the data in the maps
const std::map< std::string, SolutionData * > & SolutionData::getSDMap |
( |
| ) |
|
- Returns
- the solution data recursive map
SolutionData * SolutionData::getSDMapEntry |
( |
std::string |
key | ) |
|
- Parameters
-
- Returns
- : the value corresponding to the key in the SolutionData map.
int SolutionData::getSize |
( |
| ) |
|
- Returns
- : the indentation to leave between the line begining and the start of the values
std::string SolutionData::getSpace |
( |
| ) |
|
- Returns
- : the space to leave for this specific map for human readable string.
std::multimap< std::string, std::string > SolutionData::getStringAsMultimapMap |
( |
| ) |
|
transform the string map into a multimap of strings
- Returns
- string multimap
const std::map< std::string, std::string > & SolutionData::getStringMap |
( |
| ) |
|
std::string SolutionData::getStringMapEntry |
( |
std::string |
key | ) |
|
- Parameters
-
key | the key to look for in the string map |
- Returns
- : the value corresponding to the key in the string map.
void SolutionData::incrementMapEntry |
( |
std::string |
key | ) |
|
search in the int (first) and the double maps the key param and if found increment by 1 its value.
- Parameters
-
key | the key of the value to increment |
void SolutionData::incrementMapEntry |
( |
std::string |
key, |
|
|
int |
val |
|
) |
| |
search in the int (first) and the double maps the key param and if found increment by val its value.
- Parameters
-
key | the key of the value to increment |
val | the value with which to increment the value corresponding to the key |
void SolutionData::loadFromJsonValue |
( |
Json::Value |
root | ) |
|
Fill the maps with data retrived from root, a json value.
- Parameters
-
root | a json value containing solutionData info |
void SolutionData::setMapEntry |
( |
std::string |
key, |
|
|
int |
val |
|
) |
| |
- Parameters
-
key | the key of the int value val |
val | the value to store in the map |
void SolutionData::setMapEntry |
( |
std::string |
key, |
|
|
double |
val |
|
) |
| |
- Parameters
-
key | the key of the double value val |
val | the value to store in the map |
void SolutionData::setMapEntry |
( |
std::string |
key, |
|
|
std::string |
val |
|
) |
| |
- Parameters
-
key | the key of the string value val |
val | the value to store in the map |
void SolutionData::setMapEntry |
( |
std::string |
key, |
|
|
SolutionData * |
val |
|
) |
| |
- Parameters
-
key | the key of the SolutionData* value val |
val | the value to store in the map |
void SolutionData::setSize |
( |
int |
s | ) |
|
- Parameters
-
s | the indentation to leave between the line begining and the start of the values |
The documentation for this class was generated from the following files:
- src/GTP/GTPTools/solutionTools/solutiondata.h
- src/GTP/GTPTools/solutionTools/solutiondata.cpp