#pragma once #include "memory" #include "json.hpp" #include #include #include #include #include "Input.h" #include "Output.h" #include #include namespace mdd { class Connector { private: Registration regi = Registration(); IProcessor::Ptr _root; IOptimizer::Ptr _opt; const std::map> _ops = {//const std::map _ops = { {"add", std::bind(&Connector::add,this,std::placeholders::_1) }, {"change", std::bind(&Connector::change,this,std::placeholders::_1)}, {"load", std::bind(&Connector::load,this,std::placeholders::_1)}, {"remove", std::bind(&Connector::remove,this,std::placeholders::_1)}, {"save", std::bind(&Connector::save,this,std::placeholders::_1)}, {"state", std::bind(&Connector::state,this,std::placeholders::_1)} }; std::function _callback; /** *subject *object **/ //refernece funktioniert nicht!???? json add(const json& args); /** *subject *object **/ json remove(const json& args); /** *subject *object **/ json change(const json& args); /** *subject *object **/ json state(const json& args); json save(const json& args); json load(const json& args); json optimizerCallback(const json& callback); public: Connector(); json decode(const json& request); json encode(); void attachCallback(std::function callback); }; }