ModuleBase.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef MDD_ModuleBase_H
  2. #define MDD_ModuleBase_H
  3. #include "Input.h"
  4. #include "Output.h"
  5. #include "IModule.h"
  6. #include "Generator.h"
  7. namespace mdd {
  8. class ModuleBase : public IModule{
  9. private:
  10. std::string _type = "";
  11. int _appendix = 0;
  12. std::string _base_config = "";
  13. protected:
  14. ModuleBase(const std::string& base_config = "{}");
  15. std::vector<std::shared_ptr<Input>> inputs;
  16. std::vector<std::shared_ptr<Output>> outputs;
  17. public:
  18. bool configure(const std::string& config) { return true; };
  19. std::string getBaseConfiguration();
  20. size_t getNumInputs() override;
  21. size_t getNumOutputs() override;
  22. std::shared_ptr<IInput> getInput(size_t index) override;
  23. std::shared_ptr<IInput> getInput(const std::string& id) override;
  24. std::shared_ptr<IOutput> getOutput(size_t index) override;
  25. std::shared_ptr<IOutput> getOutput(const std::string& id) override;
  26. std::string setType(const std::string& type) override;
  27. std::string getType() override;
  28. std::string getID() override;
  29. std::string setAppendix(int appendix) override;
  30. int getAppendix() override;
  31. void load(const json& j) override;
  32. json dump() override;
  33. void disconnect() override;
  34. };
  35. }
  36. #endif //MDD_BASEMODULE_H