ProcessorBase.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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 _prefix;
  11. std::string _type;
  12. int _appendix;
  13. std::vector<Input> _processor_inputs;
  14. std::vector<std::shared_ptr<Output>> _processor_outputs;
  15. std::vector<HandlerModule> _module_inputs;
  16. std::vector<HandlerModule> _module_outputs;
  17. std::vector<std::shared_ptr<IModule>> _modules;
  18. public:
  19. void setType(std:: string type) override;
  20. std::string getType() override;
  21. std::string addModule(std::shared_ptr<IModule> module) override ;
  22. std::string addProcesorInput(const std::string& type, int const json& value,
  23. const std::function<bool(const json&)>& verification = [](
  24. const json&) { return true; });
  25. std::string addModuleInput(std::string moduleHandler, std::string inputHandler);
  26. std::string addModuleOutput(std::string moduleHandler, std::string outputHandler);
  27. std::string addProcessorOutput(const std::string& type, const json& initial);
  28. json& setInputDefaultValue(std::string input_id) override;
  29. json& setOutputValue(int handle);
  30. const json& getInputValue(int handle) override;
  31. bool connectInput(std::string input_id, std::shared_ptr<IOutput> output) override;
  32. std::vector<std::string> getInputs() override;
  33. std::vector<std::string> getOutputs() override;
  34. std::shared_ptr<IOutput> getOutput(std::string output_id) override;
  35. std::vector<std::string> getModules() override;
  36. std::shared_ptr<IModule> getModule(std::string module_id) override;
  37. };
  38. }
  39. #endif