39 #include "vtkMySQLDatabase.h"
45 #include "QGoIOConfigure.h"
72 template<
typename T >
73 void SetField(
const std::string& key,
const T& value)
77 if ( it != m_MapRow.end() )
79 it->second = ConvertToString< T >(value);
83 std::cerr <<
"This field does not exist!!!" << std::endl;
94 void SetField(
const std::string& key,
const std::string& value);
100 std::string GetTableName();
106 std::string GetTableIDName();
112 std::string PrintValues();
118 std::string PrintColumnNames();
121 std::vector< std::string > PrintColumnsAndValues();
127 std::vector< std::string > GetVectorColumnNames();
133 std::string PrintColumnNamesWithValues();
139 StringMapConstIterator ConstMapBegin();
145 StringMapConstIterator ConstMapEnd();
151 StringMapIterator MapBegin();
157 StringMapIterator MapEnd();
166 std::string GetMapValue(
const std::string& key);
171 std::string Value = this->GetMapValue(key);
172 return ss_atoi<T>(Value);
186 os << it->first <<
" = " << it->second << std::endl;
199 virtual bool SetValuesForSpecificID(
int ID, vtkMySQLDatabase *iDatabaseConnector);
205 void DeleteFromDB(vtkMySQLDatabase *iDatabaseConnector);
212 virtual void InitializeMap() = 0;
220 void AddConditions(
const std::string& iNameOfField,
221 std::vector<FieldWithValue>& ioFieldWithValue);
T GetMapValue(const std::string &key)
abstract class manages a map with keys matching fields of a gofiguredatabase table and values of the ...
friend std::ostream & operator<<(std::ostream &os, const GoDBRow &c)
print the keys and values of the map in a cout
std::string m_TableIDName
std::map< std::string, std::string > StringMapType
StringMapType::const_iterator StringMapConstIterator
StringMapType::iterator StringMapIterator
void SetField(const std::string &key, const T &value)
convert the value into a string and assign it to the key in the map