Newer
Older
/*
*
* Created on: Mar 1, 2021
* Author: astrisw
*
*/
protected:
std::map<std::string, std::string> stats;
virtual std::map<std::string, std::string> getStatsMap() const { return stats;}
std::optional<std::string> getStat(std::string stat) const {
try {
return this->stats.at(stat);
} catch (const std::out_of_range &) {
std::cerr << "No stat with name " << stat << std::endl;
return std::nullopt;
}
}