#ifndef MDD_INPUT_H #define MDD_INPUT_H #include #include #include "IInput.h" #include "IModule.h" #include #include "IUnique.h" namespace mdd { class Input : public IInput , public std::enable_shared_from_this { private: std::string _name; int _appendix; std::weak_ptr _parent; std::vector _value; //std::function _verification; std::shared_ptr _output; bool _optimizable; std::shared_ptr _limit; protected: json _base_config; std::string type; std::string key; bool configureChild(const json& config) override { return true; }; public: Input(const std::string& name, int appendix, const std::vector& default_value = std::vector({ 1 })); //const std::function &verification = [](const json&) { return true; } std::string getType() override; std::string getGeneratorKey() 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 setParent(std::shared_ptr parent) override; std::vector getParentID() override; state getState() override; void resetState() override; const std::vector& getValue() override; std::vector& setValue() override; state setValue(const std::vector& val) override; bool isOptimizable() override; void setOptimizability(bool state) override; const std::shared_ptr getLimits() override; std::shared_ptr& setLimits() override; std::shared_ptr getConnection() override; //bool verify(const json & data) override; int addConnection(std::shared_ptr output) override; int removeConnection(std::shared_ptr output = nullptr) override; bool connect(std::shared_ptr output) override; void disconnect() override; bool configure(const json& config) override; const json& getConfiguration() override; void load(const json& j) override; json dump() override; json getIdentifier() override; }; } #endif //MDD_INPUT_H