#pragma once #include "Input.h" #include "Output.h" #include "IModule.h" namespace mdd { class ModuleBase : public IModule{ private: int _appendix = 0; protected: std::weak_ptr _parent; json _base_config; ModuleBase(const std::string& base_config = "{}"); const std::string type = "module"; std::string key; std::vector> inputs; std::vector> outputs; bool configureChild(const json& config) override { return true; }; public: bool configure(const json& config) override; const json& getConfiguration() override; size_t getNumInputs() override; size_t getNumOutputs() override; std::shared_ptr getInput(size_t index) override; std::shared_ptr getInput(const json& jid) override; std::shared_ptr getOutput(size_t index) override; std::shared_ptr getOutput(const json& jid) override; std::vector> getOptimizableInputs() override; std::vector> getOptimizableOutputs() override; void setParent(std::shared_ptr parent) override; std::vector getParentID() override; std::string getGeneratorKey() override; std::string getType() override; std::string setAppendix(int appendix) override; int getAppendix() override; std::string getID() override; void load(const json& j) override; json dump() override; json getIdentifier() override; void disconnect() override; }; }