Input.h 910 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef MDD_INPUT_H
  2. #define MDD_INPUT_H
  3. #include <string>
  4. #include <functional>
  5. #include "Output.h"
  6. #include <bits/shared_ptr.h>
  7. #include "IUnique.h"
  8. namespace mdd {
  9. class Input : public IUnique{
  10. private:
  11. std::string _prefix;
  12. std::string _type;
  13. int _appendix;
  14. public:
  15. json value;
  16. std::function<bool(const json &)> verification;
  17. std::shared_ptr <IOutput> output;
  18. Input(const std::string &type, int appendix, const json &default_value,
  19. const std::function<bool(const json &)> &verification = [](
  20. const json &) { return true; });
  21. void setType(std::string type) override;
  22. std::string getType() override;
  23. std::string getID() override;
  24. std::string setPrefix(std::string prefix) override;
  25. std::string setAppendix(int appendix) override;
  26. };
  27. }
  28. #endif //MDD_INPUT_H