Output.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef MDD_OUTPUT_H
  2. #define MDD_OUTPUT_H
  3. #include "IOutput.h"
  4. #include "IInput.h"
  5. #include "IModule.h"
  6. namespace mdd {
  7. class Output : public IOutput{
  8. private:
  9. state _state;
  10. json _value;
  11. std::string _prefix;
  12. std::string _type;
  13. int _appendix;
  14. std::vector<std::shared_ptr<IInput>> _connections;
  15. protected:
  16. public:
  17. Output(const std::string& type, int appendix, const json& initial);
  18. const json& getValue() override;
  19. json& getValueInternal() override;
  20. state getState() override;
  21. void resetState() override;
  22. std::string setType(std::string type) override;
  23. std::string getType() override;
  24. std::string getID() override;
  25. std::string setPrefix(std::string prefix) override;
  26. std::string setAppendix(int appendix) override;
  27. int addConnection(std::shared_ptr<IInput> input) override;
  28. int removeConnection(std::shared_ptr<IInput> input) override;
  29. bool connect(std::shared_ptr<IInput> input) override;
  30. std::vector<std::shared_ptr<IInput>> getConnections() override;
  31. };
  32. }
  33. #endif