Input.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef MDD_INPUT_H
  2. #define MDD_INPUT_H
  3. #include <string>
  4. #include <functional>
  5. #include "IInput.h"
  6. #include "IOutput.h"
  7. #include <memory>
  8. #include "IUnique.h"
  9. namespace mdd {
  10. class Input : public IInput{
  11. private:
  12. std::string _prefix;
  13. std::string _type;
  14. int _appendix;
  15. std::vector<double> _value;
  16. //std::function<bool(const json &)> _verification;
  17. std::shared_ptr <IOutput> _output;
  18. bool _optimizable;
  19. limits _limit;
  20. protected:
  21. public:
  22. Input(const std::string &type, int appendix, const std::vector<double>& default_value);
  23. //const std::function<bool(const json &)> &verification = [](const json&) { return true; }
  24. std::string setType(std::string type) override;
  25. std::string getType() override;
  26. std::string getID() override;
  27. std::string setPrefix(std::string prefix) override;
  28. std::string setAppendix(int appendix) override;
  29. state getState() override;
  30. void resetState() override;
  31. const std::vector<double>& getValue() override;
  32. std::vector<double>& setValue() override;
  33. state setValue(const std::vector<double>& val) override;
  34. bool isOptimizable() override;
  35. void setOptimizability(bool state) override;
  36. const limits& getLimits() override;
  37. limits& setLimits() override;
  38. std::shared_ptr<IOutput> getConnection() override;
  39. //bool verify(const json & data) override;
  40. int addConnection(std::shared_ptr<IOutput> output) override;
  41. int removeConnection(std::shared_ptr<IOutput> output) override;
  42. bool connect(std::shared_ptr<IOutput> output) override;
  43. };
  44. }
  45. #endif //MDD_INPUT_H