ProcessorBase.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef MDD_PROCESSORBASE_H
  2. #define MDD_PROCESSORBASE_H
  3. #include <list>
  4. #include "Input.h"
  5. #include "IProcessor.h"
  6. #include "HandlerModule.h"
  7. namespace mdd {
  8. class ProcessorBase : public IProcessor{
  9. private:
  10. std::string _type;
  11. //std::vector<Input> _processor_inputs;
  12. //std::vector<std::shared_ptr<Output>> _processor_outputs;
  13. std::vector<HandlerModule> _module_inputs;
  14. std::vector<HandlerModule> _module_outputs;
  15. std::vector<std::shared_ptr<IModule>> _modules;
  16. public:
  17. void setType(std:: string type);
  18. std::string getType() override;
  19. int addModule(std::shared_ptr<IModule> module) override ;
  20. //int addInput(const std::string& type, const json& value,
  21. // const std::function<bool(const json&)>& verification = [](
  22. // const json&) { return true; });
  23. int addInput(int moduleHandler, int inputHandler);
  24. int addOutput(int moduleHandler, int outputHandler);
  25. //int addOutput(const std::string& type, const json& initial);
  26. json& setInputDefaultValue(int handle) override;
  27. //json& setOutputValue(int handle);
  28. const json& getInputValue(int handle) override;
  29. bool connectInput(int handle, std::shared_ptr<IOutput> output) override;
  30. std::vector<std::string> getInputs() override;
  31. std::vector<std::string> getOutputs() override;
  32. std::shared_ptr<IOutput> getOutput(int handle) override;
  33. std::vector<std::string> getModules() override;
  34. std::shared_ptr<IModule> getModule(int handle) override;
  35. };
  36. }
  37. #endif