Commit 222f8b2e authored by Micha Mueller's avatar Micha Mueller
Browse files

Rename Configurator -> ConfiguratorTemplate

parent 26585a60
......@@ -5,8 +5,8 @@
* Author: Micha Mueller
*/
#ifndef SRC_CONFIGURATOR_H_
#define SRC_CONFIGURATOR_H_
#ifndef SRC_CONFIGURATORTEMPLATE_H_
#define SRC_CONFIGURATORTEMPLATE_H_
#include "ConfiguratorInterface.h"
......@@ -21,7 +21,7 @@
* Non-virtual interface template for the configurators.
*/
template <typename S>
class Configurator : public ConfiguratorInterface {
class ConfiguratorTemplate : public ConfiguratorInterface {
//the template shall only be instantiated for classes which implement the sensor interface
static_assert(std::is_base_of<Sensor, S>::value, "S must derive from Sensor!");
......@@ -29,9 +29,9 @@ protected:
typedef std::map<std::string, S> sensorMap_t;
public:
Configurator() : _cacheInterval(900000) {}
ConfiguratorTemplate() : _cacheInterval(900000) {}
virtual ~Configurator() {
virtual ~ConfiguratorTemplate() {
for (auto s : _sensors) {
delete s;
}
......@@ -206,4 +206,4 @@ protected:
boost::log::sources::severity_logger<boost::log::trivial::severity_level> lg;
};
#endif /* SRC_CONFIGURATOR_H_ */
#endif /* SRC_CONFIGURATORTEMPLATE_H_ */
......@@ -8,8 +8,6 @@
#ifndef BACNETCONFIGURATOR_H_
#define BACNETCONFIGURATOR_H_
#include "../../Configurator.h"
#include "BACnetSensor.h"
#include "BACnetClient.h"
......@@ -18,7 +16,9 @@
#include <map>
#include <boost/property_tree/ptree.hpp>
class BACnetConfigurator: public Configurator<BACnetSensor> {
#include "../../ConfiguratorTemplate.h"
class BACnetConfigurator: public ConfiguratorTemplate<BACnetSensor> {
typedef std::map<std::string, BACnetSensor> sensorMap_t;
......@@ -43,7 +43,7 @@ public:
delete _bacClient;
_bacClient = NULL;
_templateSensors.clear();
return Configurator::reReadConfig();
return ConfiguratorTemplate::reReadConfig();
}
private:
......@@ -60,11 +60,11 @@ private:
sensorMap_t _templateSensors;
};
extern "C" Configurator* create() {
extern "C" ConfiguratorTemplate* create() {
return new BACnetConfigurator;
}
extern "C" void destroy(Configurator* c) {
extern "C" void destroy(ConfiguratorTemplate* c) {
delete c;
}
......
......@@ -6,6 +6,7 @@
*/
#include "IPMIConfigurator.h"
#include "IPMIHost.h"
#include "IPMISensor.h"
......
......@@ -10,17 +10,17 @@
#include "IPMISensor.h"
#include "IPMIHost.h"
#include "../../Configurator.h"
#include <boost/property_tree/ptree.hpp>
#include <string>
#include <map>
#include <list>
#include <vector>
#include "../../ConfiguratorTemplate.h"
namespace DCDB {
class IPMIConfigurator : public Configurator<IPMISensor> {
class IPMIConfigurator : public ConfiguratorTemplate<IPMISensor> {
typedef std::list<DCDB::IPMIHost> hostList_t;
typedef std::map<std::string, DCDB::IPMISensor> sensorMap_t;
......@@ -37,7 +37,7 @@ namespace DCDB {
//Overwrite from Configurator
void setGlobalSettings(const pluginSettings_t& pluginSettings) {
Configurator::setGlobalSettings(pluginSettings);
ConfiguratorTemplate::setGlobalSettings(pluginSettings);
_tempdir = pluginSettings.tempdir;
}
......@@ -49,7 +49,7 @@ namespace DCDB {
sleep(10);
_hosts.clear();
_templateSensors.clear();
return Configurator::reReadConfig();
return ConfiguratorTemplate::reReadConfig();
}
private:
......@@ -70,11 +70,11 @@ namespace DCDB {
} /* namespace DCDB */
extern "C" Configurator* create() {
extern "C" ConfiguratorTemplate* create() {
return new DCDB::IPMIConfigurator;
}
extern "C" void destroy(Configurator* c) {
extern "C" void destroy(ConfiguratorTemplate* c) {
delete c;
}
......
......@@ -5,7 +5,6 @@
* Author: Micha Mueller
*/
#include "../../Configurator.h"
#include "PDUSensor.h"
#include "PDUUnit.h"
#include <string>
......@@ -14,10 +13,12 @@
#include <list>
#include <boost/property_tree/ptree.hpp>
#include "../../ConfiguratorTemplate.h"
#ifndef SRC_SENSORS_PDU_PDUCONFIGURATOR_H_
#define SRC_SENSORS_PDU_PDUCONFIGURATOR_H_
class PDUConfigurator: public Configurator<PDUSensor> {
class PDUConfigurator: public ConfiguratorTemplate<PDUSensor> {
typedef std::map<std::string, PDUSensor> sensorMap_t;
typedef std::list<PDUUnit> pduList_t;
......@@ -42,7 +43,7 @@ public:
sleep(10);
_pdus.clear();
_templateSensors.clear();
return Configurator::reReadConfig();
return ConfiguratorTemplate::reReadConfig();
}
private:
......@@ -65,11 +66,11 @@ private:
pduList_t _pdus;
};
extern "C" Configurator* create() {
extern "C" ConfiguratorTemplate* create() {
return new PDUConfigurator;
}
extern "C" void destroy(Configurator* c) {
extern "C" void destroy(ConfiguratorTemplate* c) {
delete c;
}
......
......@@ -6,6 +6,7 @@
*/
#include "PerfeventConfigurator.h"
#include <iostream>
#include <sstream>
#include <string>
......
......@@ -9,14 +9,15 @@
#define PERFEVENTCONFIGURATOR_H_
#include "PerfCounter.h"
#include "../../Configurator.h"
#include <string>
#include <vector>
#include <map>
#include <set>
#include <boost/property_tree/ptree.hpp>
class PerfeventConfigurator : public Configurator<PerfCounter> {
#include "../../ConfiguratorTemplate.h"
class PerfeventConfigurator : public ConfiguratorTemplate<PerfCounter> {
typedef std::map<std::string, PerfCounter> counterMap_t;
typedef std::map<std::string, std::set<int>> templateCpuMap_t;
......@@ -38,7 +39,7 @@ public:
bool reReadConfig() {
_templateCounters.clear();
_templateCpus.clear();
return Configurator::reReadConfig();
return ConfiguratorTemplate::reReadConfig();
}
private:
......@@ -78,11 +79,11 @@ private:
enumMap_t _enumConfig;
};
extern "C" Configurator* create() {
extern "C" ConfiguratorTemplate* create() {
return new PerfeventConfigurator;
}
extern "C" void destroy(Configurator* c) {
extern "C" void destroy(ConfiguratorTemplate* c) {
delete c;
}
......
......@@ -8,14 +8,14 @@
#ifndef SNMPCONFIGURATOR_H_
#define SNMPCONFIGURATOR_H_
#include "../../Configurator.h"
#include "SNMPSensor.h"
#include "SNMPConnection.h"
#include <list>
class SNMPConfigurator : public Configurator<SNMPSensor> {
#include "../../ConfiguratorTemplate.h"
class SNMPConfigurator : public ConfiguratorTemplate<SNMPSensor> {
typedef std::list<SNMPConnection> connectionList_t;
......
......@@ -6,6 +6,7 @@
*/
#include "SysfsConfigurator.h"
#include <iostream>
#include <boost/foreach.hpp>
......
......@@ -9,13 +9,14 @@
#define SYSFSCONFIGURATOR_H_
#include "SysfsSensor.h"
#include "../../Configurator.h"
#include <string>
#include <vector>
#include <map>
#include <boost/property_tree/ptree.hpp>
class SysfsConfigurator : public Configurator<SysfsSensor> {
#include "../../ConfiguratorTemplate.h"
class SysfsConfigurator : public ConfiguratorTemplate<SysfsSensor> {
typedef std::map<std::string, SysfsSensor> sensorMap_t;
......@@ -34,7 +35,7 @@ public:
//Overwrite from Configurator
bool reReadConfig() {
_templateSensors.clear();
return Configurator::reReadConfig();
return ConfiguratorTemplate::reReadConfig();
}
private:
......@@ -48,11 +49,11 @@ private:
sensorMap_t _templateSensors;
};
extern "C" Configurator* create() {
extern "C" ConfiguratorTemplate* create() {
return new SysfsConfigurator;
}
extern "C" void destroy(Configurator* c) {
extern "C" void destroy(ConfiguratorTemplate* c) {
delete c;
}
......
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