Configurator.h 1.01 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
/*
 * Configurator.h
 *
 *  Created on: 13.01.2018
 *      Author: Micha Mueller
 */

#ifndef SRC_CONFIGURATOR_H_
#define SRC_CONFIGURATOR_H_

11
12
#include "Sensor.h"

13
14
#include <vector>
#include <string>
15

Micha Mueller's avatar
Micha Mueller committed
16
17
18
/**
 * Abstract base class, which defines the interface for the configurators in the shared dynamic libraries.
 */
19
20
21
22
23
class Configurator {
public:
	Configurator() {}
	virtual ~Configurator() {}

Micha Mueller's avatar
Micha Mueller committed
24
25
26
27
28
	/**
	 * Read in the given configuration
	 * @param	cfgPath Path to the config-file
	 * @return	Reference to the vector of sensors which were created
	 */
29
	virtual std::vector<Sensor*>& readConfig(std::string cfgPath) = 0;
30
31
32
33
34
35
36

	void setMqttPrefix(const std::string& mqttPrefix) {
		_mqttPrefix = mqttPrefix;
	}

protected:
	std::string _mqttPrefix;
37
	boost::log::sources::severity_logger<boost::log::trivial::severity_level> lg;
38
39
};

Micha Mueller's avatar
Micha Mueller committed
40
//typedef for more readable usage of create()- and destroy()-methods, required for dynamic libraries
41
42
43
44
typedef Configurator* create_t();
typedef void destroy_t(Configurator*);

#endif /* SRC_CONFIGURATOR_H_ */