Commit 921d5591 authored by Micha Mueller's avatar Micha Mueller
Browse files

Rename CFG_TREE to CFG_VAL

parent 920b539b
......@@ -19,7 +19,7 @@
#include "SensorGroupTemplate.h"
//#define STRCMP(node,str) boost::iequals(node.first,str) //DEPRECATED
#define CFG_TREE boost::property_tree::iptree&
#define CFG_VAL boost::property_tree::iptree&
#define ADD BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config)
#define ATTRIBUTE(name,setter) if (boost::iequals(val.first, name)) { s.setter(val.second.data()); }
......@@ -207,7 +207,7 @@ public:
*
* @return Vector containing pointers to all sensor groups of this plugin
*/
std::vector<SensorGroupInterface*>& getSensorGroups() {
std::vector<SensorGroupInterface*>& getSensorGroups() final {
return _sensorGroups;
}
......@@ -223,7 +223,7 @@ protected:
*
* @return True on success, false otherwise
*/
bool readSensorBase(SBase& sBase, boost::property_tree::iptree& config) {
bool readSensorBase(SBase& sBase, CFG_VAL config) {
//TODO default templates useful?
BOOST_FOREACH(boost::property_tree::iptree::value_type &val, config) {
if (boost::iequals(val.first, "mqttsuffix")) {
......@@ -244,7 +244,7 @@ protected:
*
* @return True on success, false otherwise
*/
bool readSensorGroup(SGroup& sGroup, boost::property_tree::iptree& config) {
bool readSensorGroup(SGroup& sGroup, CFG_VAL config) {
sGroup.setCacheInterval(_cacheInterval);
//first check if default group is given
boost::optional<boost::property_tree::iptree&> def = config.get_child_optional("default");
......@@ -298,7 +298,7 @@ protected:
*
* @return True on success, false otherwise
*/
bool readSensorEntity(SEntity& sEntity, boost::property_tree::iptree& config) {
bool readSensorEntity(SEntity& sEntity, CFG_VAL config) {
//first check if default entity is given
boost::optional<boost::property_tree::iptree&> def = config.get_child_optional("default");
if(def) {
......@@ -316,7 +316,7 @@ protected:
return true;
}
bool readGlobal(boost::property_tree::iptree& config) {
bool readGlobal(CFG_VAL config) {
boost::optional<boost::property_tree::iptree&> globalVals = config.get_child_optional("global");
if (globalVals) {
BOOST_FOREACH(boost::property_tree::iptree::value_type &global, config.get_child("global")) {
......@@ -354,7 +354,7 @@ protected:
* @param sBase The sensor base for which to set the values
* @param config A boost property (sub-)tree containing the sensor values
*/
virtual void sensorBase(SBase& s, boost::property_tree::iptree& config) = 0;
virtual void sensorBase(SBase& s, CFG_VAL config) = 0;
/**
* Pure virtual interface method, responsible for reading plugin-specific sensor
......@@ -363,7 +363,7 @@ protected:
* @param sGroup The sensor group for which to set the values
* @param config A boost property (sub-)tree containing the group values
*/
virtual void sensorGroup(SGroup& s, boost::property_tree::iptree& config) = 0;
virtual void sensorGroup(SGroup& s, CFG_VAL config) = 0;
/**
* Virtual interface method, responsible for reading plugin-specific sensor
......@@ -372,7 +372,7 @@ protected:
* @param sEntity The sensor entity for which to set the values
* @param config A boost property (sub-)tree containing the entity values
*/
virtual void sensorEntity(SEntity& s, boost::property_tree::iptree& config) {
virtual void sensorEntity(SEntity& s, CFG_VAL config) {
//Overwrite if necessary
LOG(warning) << "Method sensorEntity called, but was not overwritten! Either you have unwanted entitys in your config file or forgot to overwrite this method";
}
......@@ -382,7 +382,7 @@ protected:
*
* @param config A boost property (sub-)tree containing the global values
*/
virtual void global(boost::property_tree::iptree& config) {}
virtual void global(CFG_VAL config) {}
std::string _entityName;
std::string _groupName;
......
......@@ -7,13 +7,13 @@
#include "SysfsConfigurator.h"
void SysfsConfigurator::sensorBase(SysfsSensorBase& s, CFG_TREE config) {
void SysfsConfigurator::sensorBase(SysfsSensorBase& s, CFG_VAL config) {
ADD {
ATTRIBUTE("path", setPath)
ATTRIBUTE("filter", setFilter)
}
}
void SysfsConfigurator::sensorGroup(SysfsSensorGroup& s, CFG_TREE config) {
void SysfsConfigurator::sensorGroup(SysfsSensorGroup& s, CFG_VAL config) {
//no group attributes currently
}
......@@ -23,8 +23,8 @@ public:
protected:
/* Overwritten from ConfiguratorTemplate */
void sensorBase(SysfsSensorBase& s, CFG_TREE config) override;
void sensorGroup(SysfsSensorGroup& s, CFG_TREE config) override;
void sensorBase(SysfsSensorBase& s, CFG_VAL config) override;
void sensorGroup(SysfsSensorGroup& s, CFG_VAL config) override;
};
extern "C" ConfiguratorInterface* create() {
......
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