mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-12 16:21:13 +00:00
Adding helper function to print the raw boost property tree
This commit is contained in:
parent
e184610c06
commit
9943be507e
|
@ -28,7 +28,8 @@ FairMQMap ptreeToMQMap(const boost::property_tree::ptree& pt, const string& id,
|
|||
{
|
||||
// Create fair mq map
|
||||
FairMQMap channelMap;
|
||||
// helper::PrintDeviceList(pt.get_child(rootNode));
|
||||
//Helper::PrintPropertyTree(pt);
|
||||
//Helper::PrintDeviceList(pt.get_child(rootNode), formatFlag);
|
||||
// Extract value from boost::property_tree
|
||||
Helper::DeviceParser(pt.get_child(rootNode), channelMap, id, formatFlag);
|
||||
|
||||
|
@ -433,6 +434,14 @@ void SocketParser(const boost::property_tree::ptree& tree, vector<FairMQChannel>
|
|||
}
|
||||
}
|
||||
|
||||
void PrintPropertyTree(const boost::property_tree::ptree& tree, int level)
|
||||
{
|
||||
for (const auto& p : tree) {
|
||||
std::cout << std::setw(level+1) << level << ": " << p.first << " " << p.second.get_value<string>() << std::endl;
|
||||
PrintPropertyTree(p.second.get_child(""), level + 1);
|
||||
}
|
||||
}
|
||||
|
||||
} // Helper namespace
|
||||
|
||||
} // FairMQParser namespace
|
||||
|
|
|
@ -43,6 +43,7 @@ void PrintDeviceList(const boost::property_tree::ptree& tree, const std::string&
|
|||
void DeviceParser(const boost::property_tree::ptree& tree, FairMQMap& channelMap, const std::string& deviceId, const std::string& formatFlag);
|
||||
void ChannelParser(const boost::property_tree::ptree& tree, FairMQMap& channelMap, const std::string& formatFlag);
|
||||
void SocketParser(const boost::property_tree::ptree& tree, std::vector<FairMQChannel>& channelList, const std::string& channelName, const FairMQChannel& commonChannel);
|
||||
void PrintPropertyTree(const boost::property_tree::ptree& tree, int level = 0);
|
||||
|
||||
} // Helper namespace
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user