Output.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #ifndef MDD_OUTPUT_H
  2. #define MDD_OUTPUT_H
  3. #include "IOutput.h"
  4. #include "IModule.h"
  5. namespace mdd {
  6. class Output : public IOutput{
  7. private:
  8. state _state;
  9. std::vector<double> _value;
  10. std::string _name;
  11. int _appendix;
  12. std::vector<std::shared_ptr<IInput>> _connections;
  13. bool _optimizable;
  14. IModule* _parent;
  15. protected:
  16. std::string type;
  17. std::string key;
  18. public:
  19. Output(IModule* parent, const std::string& name, int appendix, const std::vector<double>& initial);
  20. const std::vector<double>& getValue() override;
  21. std::vector<double>& setValue() override;
  22. state setValue(const std::vector<double>& val) override;
  23. bool isOptimizable();
  24. void setOptimizability(bool state);
  25. state getState() override;
  26. void resetState() override;
  27. std::string getType() override;
  28. std::string getGeneratorKey() override;
  29. std::string setName(const std::string& name) override;
  30. std::string getName() override;
  31. std::string setAppendix(int appendix) override;
  32. int getAppendix() override;
  33. std::string getID() override;
  34. std::string getParentID() override;
  35. int addConnection(std::shared_ptr<IInput> input) override;
  36. int removeConnection(std::shared_ptr<IInput> input) override;
  37. bool connect(std::shared_ptr<IInput> input) override;
  38. std::vector<std::shared_ptr<IInput>> getConnections() override;
  39. void disconnect() override;
  40. bool configure(const std::string& config) override;
  41. std::string getConfiguration() override;
  42. void load(const json& j) override;
  43. json dump() override;
  44. };
  45. }
  46. #endif