ModuleBase.h 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. #ifndef MDD_ModuleBase_H
  2. #define MDD_ModuleBase_H
  3. #include "Input.h"
  4. #include "IModule.h"
  5. namespace mdd {
  6. class ModuleBase : public IModule{
  7. private:
  8. std::string _type;
  9. std::vector<Input> _inputs;
  10. std::vector<std::shared_ptr<Output>> _outputs;
  11. public:
  12. int addInput(const std::string& type, const json& value,
  13. const std::function<bool(const json&)>& verification = [](
  14. const json&) { return true; });
  15. void setType(std:: string type);
  16. std::string getType() override;
  17. json& setInputDefaultValue(int handle) override;
  18. const json& getInputValue(int handle) override;
  19. bool connectInput(int handle, std::shared_ptr<IOutput> output) override;
  20. std::vector<std::string> getInputs() override;
  21. std::vector<std::string> getOutputs() override;
  22. std::shared_ptr<IOutput> getOutput(int handle) override;
  23. int addOutput(const std::string& type, const json& initial);
  24. json &setOutputValue(int handle);
  25. };
  26. }
  27. #endif //MDD_BASEMODULE_H