Skip to content
Base_Configurator.h 753 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 int readConfigFromSource() = 0;
	virtual int readConfigFromSource(std::string target) = 0;
	virtual int pushConfigToSource() = 0;
	virtual int pushConfigToSource(std::string target) = 0;
	virtual int insert(std::map<std::string, std::string>, std::string target);
	virtual std::map<std::string, std::string> getConfig() {return this->config;}
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
}