1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- #ifndef MDD_ModuleBase_H
- #define MDD_ModuleBase_H
- #include "Input.h"
- #include "Output.h"
- #include "IModule.h"
- namespace mdd {
- class ModuleBase : public IModule{
- private:
- std::string _name = "";
- int _appendix = 0;
- std::string _base_config = "";
- protected:
- ModuleBase(const std::string& base_config = "{}");
- std::string type = "module";
- std::string key;
- 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 getGeneratorKey() override;
- std::string getType() override;
- std::string setName(const std::string& name) override;
- std::string getName() override;
- std::string setAppendix(int appendix) override;
- int getAppendix() override;
- std::string getID() override;
-
- void load(const json& j) override;
- json dump() override;
- void disconnect() override;
- };
- }
- #endif //MDD_BASEMODULE_H
|