Skip to content
Base_Configurator.h 531 B
Newer Older
astri's avatar
astri committed
#pragma once
Valerio Pastore's avatar
Valerio Pastore committed

#include <map>
#include <string>

astri's avatar
astri committed
namespace inaf::oasbo::Configurators {
Valerio Pastore's avatar
Valerio Pastore committed

class BaseConfigurator{
protected:
astri's avatar
astri committed
	std::map<std::string,std::string> config;
Valerio Pastore's avatar
Valerio Pastore committed

public:
astri's avatar
astri committed
	virtual std::map<std::string, std::string> readConfig() = 0;
	virtual void updateConfig(std::map<std::string, std::string>) = 0;
Valerio Pastore's avatar
Valerio Pastore committed

	std::string toString(){
		std::string ret = "";
astri's avatar
astri committed
		for( const std::pair<std::string, std::string> n : config) {
Valerio Pastore's avatar
Valerio Pastore committed
			ret += n.first + " : " + n.second + "\n";
		}
		return ret;
	}

	virtual ~BaseConfigurator() = default;

};
astri's avatar
astri committed
}