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