Connector.h 1.4 KB

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