Connector.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #include "memory"
  3. #include "json.hpp"
  4. #include "Input.h"
  5. #include "Output.h"
  6. #include <Registration.h>
  7. #include <ProcessorStandard.h>
  8. namespace mdd {
  9. class Connector {
  10. private:
  11. Registration regi = Registration();
  12. IProcessor::Ptr _root;
  13. const std::map<const std::string, std::function<json(const json&)>> _ops = {//const std::map<const std::string, const json& (Connector::*)(const json&)> _ops = {
  14. {"add", std::bind(&Connector::add,this,std::placeholders::_1) },
  15. {"remove", std::bind(&Connector::remove,this,std::placeholders::_1)},
  16. {"change", std::bind(&Connector::change,this,std::placeholders::_1)},
  17. {"state", std::bind(&Connector::state,this,std::placeholders::_1)}
  18. };
  19. bool contains_subj_obj_structure(const json& args);
  20. /**
  21. *subject
  22. *object
  23. **/
  24. //refernece funktioniert nicht!????
  25. json add(const json& args);
  26. /**
  27. *subject
  28. *object
  29. **/
  30. json remove(const json& args);
  31. /**
  32. *subject
  33. *object
  34. **/
  35. json change(const json& args);
  36. /**
  37. *subject
  38. *object
  39. **/
  40. json state(const json& args);
  41. public:
  42. Connector();
  43. json decode(const json& request);
  44. json encode();
  45. };
  46. }