mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-13 08:41:16 +00:00
Add GetProperties()
This commit is contained in:
parent
f46803a8b6
commit
5646d531f3
|
@ -17,10 +17,12 @@
|
|||
#include <boost/program_options.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <map>
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <regex>
|
||||
#include <sstream>
|
||||
|
||||
namespace fair
|
||||
|
@ -126,6 +128,20 @@ class FairMQProgOptions
|
|||
return val;
|
||||
}
|
||||
|
||||
std::map<std::string, boost::any> GetProperties(const std::string& q)
|
||||
{
|
||||
std::regex re(q);
|
||||
std::map<std::string, boost::any> result;
|
||||
|
||||
for (const auto& m : fVarMap) {
|
||||
if (std::regex_search(m.first, re)) {
|
||||
result.emplace(m.first, m.second.value());
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// Given a key, convert the variable value to string
|
||||
std::string GetStringValue(const std::string& key);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user