123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- #ifndef MDD_ModuleBase_H
- #define MDD_ModuleBase_H
- #include "Input.h"
- #include "Output.h"
- #include "IModule.h"
- #include "Generator.h"
- namespace mdd {
- class ModuleBase : public IModule{
- private:
- std::string _type = "";
- int _appendix = 0;
- std::string _base_config = "";
- protected:
- ModuleBase(const std::string& base_config = "{}");
- std::vector<std::shared_ptr<Input>> inputs;
- std::vector<std::shared_ptr<Output>> outputs;
- public:
- bool configure(const std::string& config) { return true; };
- std::string getConfiguration() override;
- size_t getNumInputs() override;
- size_t getNumOutputs() override;
- std::shared_ptr<IInput> getInput(size_t index) override;
- std::shared_ptr<IInput> getInput(const std::string& id) override;
- std::shared_ptr<IOutput> getOutput(size_t index) override;
- std::shared_ptr<IOutput> getOutput(const std::string& id) override;
- std::vector<std::shared_ptr<IInput>> getOptimizableInputs() override;
- std::vector<std::shared_ptr<IOutput>> getOptimizableOutputs() override;
-
- std::string setType(const std::string& type) override;
- std::string getType() override;
- std::string getID() override;
- std::string setAppendix(int appendix) override;
- int getAppendix() override;
-
- void load(const json& j) override;
- json dump() override;
- void disconnect() override;
- };
- }
- #endif //MDD_BASEMODULE_H
|