Connector.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. bool contains_subj_obj_structure(const json& args);
  26. /**
  27. *subject
  28. *object
  29. **/
  30. //refernece funktioniert nicht!????
  31. json add(const json& args);
  32. /**
  33. *subject
  34. *object
  35. **/
  36. json remove(const json& args);
  37. /**
  38. *subject
  39. *object
  40. **/
  41. json change(const json& args);
  42. /**
  43. *subject
  44. *object
  45. **/
  46. json state(const json& args);
  47. json save(const json& args);
  48. json load(const json& args);
  49. public:
  50. Connector();
  51. json decode(const json& request);
  52. json encode();
  53. };
  54. }