SNMPConfigurator.h 1.04 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
/*
 * SNMPConfigurator.h
 *
 *  Created on: 05.07.2018
 *      Author: Axel Auweter (original), Micha Mueller
 */

#ifndef SNMPCONFIGURATOR_H_
#define SNMPCONFIGURATOR_H_

#include "SNMPConnection.h"

Micha Mueller's avatar
Micha Mueller committed
13
#include <list>
14

15
#include "../../ConfiguratorTemplate.h"
16
#include "SNMPSingleSensor.h"
17

18
class SNMPConfigurator : public ConfiguratorTemplate<SNMPSensorBase, SNMPSingleSensor> {
19

Micha Mueller's avatar
Micha Mueller committed
20
	typedef std::list<SNMPConnection> connectionList_t;
21
22
23
24
25

public:
	SNMPConfigurator();
	virtual ~SNMPConfigurator();

26
protected:
27
	bool derivedReadConfig(boost::property_tree::iptree& cfg) override;
Micha Mueller's avatar
Micha Mueller committed
28
	void derivedReReadConfig() override { _connections.clear(); }
29
30
	void derivedSetGlobalSettings(const pluginSettings_t& pluginSettings) override { /*nothing to overwrite*/ }
	bool derivedReadSensorBase(SNMPSensorBase& sensor, boost::property_tree::iptree& config) override;
31
32

private:
Micha Mueller's avatar
Micha Mueller committed
33
	connectionList_t	_connections;
34
35
};

36
extern "C" ConfiguratorInterface* create() {
37
38
39
	return new SNMPConfigurator;
}

40
extern "C" void destroy(ConfiguratorInterface* c) {
41
42
43
44
	delete c;
}

#endif /* SNMPCONFIGURATOR_H_ */