Commit 4dc51146 authored by Micha Mueller's avatar Micha Mueller
Browse files

Add macro for global settings

parent f096313b
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#define ADD BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) #define ADD BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config)
#define ATTRIBUTE(name,setter) do { if (boost::iequals(val.first, name)) { s.setter(val.second.data()); } } while(0) #define ATTRIBUTE(name,setter) do { if (boost::iequals(val.first, name)) { s.setter(val.second.data()); } } while(0)
#define SETTING(name) if (boost::iequals(val.first, name))
/** /**
* Non-virtual interface template for the configurators. * Non-virtual interface template for the configurators.
......
...@@ -63,12 +63,13 @@ void IPMIConfigurator::finalizeGroup(IPMISensorGroup& g) { ...@@ -63,12 +63,13 @@ void IPMIConfigurator::finalizeGroup(IPMISensorGroup& g) {
} }
void IPMIConfigurator::global(CFG_VAL config) { void IPMIConfigurator::global(CFG_VAL config) {
BOOST_FOREACH(boost::property_tree::iptree::value_type &global, config) { ADD {
if (boost::iequals(global.first, "SessionTimeout")) { SETTING("SessionTimeout") {
_globalHost.sessionTimeout = stoi(global.second.data()); _globalHost.sessionTimeout = stoi(val.second.data());
LOG(debug)<< " SessionTimeout " << _globalHost.sessionTimeout; LOG(debug)<< " SessionTimeout " << _globalHost.sessionTimeout;
} else if (boost::iequals(global.first, "RetransmissionTimeout")) { }
_globalHost.retransmissionTimeout = stoi(global.second.data()); SETTING("RetransmissionTimeout") {
_globalHost.retransmissionTimeout = stoi(val.second.data());
LOG(debug) << " RetransmissionTimeout " << _globalHost.retransmissionTimeout; LOG(debug) << " RetransmissionTimeout " << _globalHost.retransmissionTimeout;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment