44 std::pair<PropertyMapIterator, bool> result = insert(make_pair(p->
name(), p));
50 if (it == end())
return false;
58 if (it->second)
delete it->second;
63 const std::string& value) {
65 if (it == end())
return false;
66 it->second->fromString(value);
71 for (
auto it = cbegin(); it != cend(); ++it) {
72 if (it != cbegin()) os <<
",";
73 os << it->second->name();
76 for (
auto it = cbegin(); it != cend(); ++it) {
77 if (it != cbegin()) os <<
",";
78 os << it->second->toString();
85 vector<string> valuesMap =
strSplit(values,
",");
86 for (
size_t i = 0; i < valuesMap.size(); ++i) {
87 vector<string> m =
strSplit(valuesMap[i],
"=");
89 G2O_DEBUG(
"{}: unable to extract name=value pair from {}",
93 string name =
trim(m[0]);
94 string value =
trim(m[1]);
BaseProperty(const std::string &name_)
const std::string & name()
bool updateMapFromString(const std::string &values)
bool updatePropertyFromString(const std::string &name, const std::string &value)
bool addProperty(BaseProperty *p)
bool eraseProperty(const std::string &name_)
void writeToCSV(std::ostream &os) const
BaseClass::iterator PropertyMapIterator
#define __PRETTY_FUNCTION__
std::string trim(const std::string &s)
std::vector< std::string > strSplit(const std::string &str, const std::string &delimiters)