9 m_intMtx(std::make_unique<std::mutex>()),
10 m_floatMtx(std::make_unique<std::mutex>()),
11 m_stringMtx(std::make_unique<std::mutex>()),
12 m_doubleMtx(std::make_unique<std::mutex>()) {
16 m_intMtx(std::make_unique<std::mutex>()),
17 m_floatMtx(std::make_unique<std::mutex>()),
18 m_stringMtx(std::make_unique<std::mutex>()),
19 m_doubleMtx(std::make_unique<std::mutex>()) {
23 auto& intMtx = other.getMutex<
int>();
24 auto& floatMtx = other.getMutex<
float>();
25 auto& stringMtx = other.getMutex<std::string>();
26 auto& doubleMtx = other.getMutex<
double>();
27 std::scoped_lock lock(intMtx, floatMtx, stringMtx, doubleMtx);
28 _intMap = other._intMap;
29 _floatMap = other._floatMap;
30 _stringMap = other._stringMap;
31 _doubleMap = other._doubleMap;
36 return getValue<int>(key);
40 return getValue<float>(key);
44 return getValue<std::string>(key);
48 for (
const auto v :
getValue<std::vector<int>>(key)) {
55 for (
const auto v :
getValue<std::vector<float>>(key)) {
62 for (
const auto& v :
getValue<std::vector<std::string>>(key)) {
69 for (
const auto& k : getKeys<int>()) {
76 for (
const auto& k : getKeys<float>()) {
83 for (
const auto& k : getKeys<std::string>()) {
90 return getN<int>(key);
94 return getN<float>(key);
98 return getN<std::string>(key);
114std::ostream&
operator<<(std::ostream& os,
const std::vector<T>& values) {
116 if (!values.empty()) {
118 for (
size_t i = 1; i < values.size(); ++i) {
119 os <<
", " << values[i];
126template <
typename MapType>
127void printMap(
const MapType& map, std::ostream& os) {
128 os << std::left << std::setw(30) <<
"Key "
130 os <<
"--------------------------------------------------------------------------------\n";
131 for (
const auto& [key, value] : map) {
132 os << std::left << std::setw(30) << key << value <<
'\n';
137 os <<
"int parameters\n\n";
139 os <<
"\nfloat parameters\n";
141 os <<
"\ndouble parameters\n";
143 os <<
"\nstd::string parameters\n";
144 printMap(getMap<std::string>(), os);
DEPRECATED_ACCESS int getIntVal(const std::string &key) const
DEPRECATED_ACCESS IntVec & getIntVals(const std::string &key, IntVec &values) const
GenericDataReturnType< T > getValue(const std::string &) const
DEPRECATED_ACCESS int getNString(const std::string &key) const
void setValue(const std::string &key, T value)
Store (a copy of) the passed value under the given key.
DEPRECATED_ACCESS void setValues(const std::string &key, const IntVec &values)
DEPRECATED_ACCESS FloatVec & getFloatVals(const std::string &key, FloatVec &values) const
DEPRECATED_ACCESS const std::string & getStringVal(const std::string &key) const
DEPRECATED_ACCESS int getNFloat(const std::string &key) const
DEPRECATED_ACCESS int getNInt(const std::string &key) const
DEPRECATED_ACCESS StringVec & getStringVals(const std::string &key, StringVec &values) const
DEPRECATED_ACCESS float getFloatVal(const std::string &key) const
void print(std::ostream &os=std::cout, bool flush=true)
DEPRECATED_ACCESS const StringVec & getIntKeys(StringVec &keys) const
DEPRECATED_ACCESS const StringVec & getFloatKeys(StringVec &keys) const
DEPRECATED_ACCESS const StringVec & getStringKeys(StringVec &keys) const
std::vector< float > FloatVec
void printMap(const MapType &map, std::ostream &os)
std::vector< int > IntVec
std::ostream & operator<<(std::ostream &o, const podio::UserDataCollection< BasicType > &coll)
std::vector< std::string > StringVec