123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #ifndef MDD_INPUT_H
- #define MDD_INPUT_H
- #include <string>
- #include <functional>
- #include "IInput.h"
- #include "IOutput.h"
- #include <memory>
- #include "IUnique.h"
- namespace mdd {
- class Input : public IInput{
- private:
- std::string _prefix;
- std::string _type;
- int _appendix;
- json _value;
- std::function<bool(const json &)> _verification;
- std::shared_ptr <IOutput> _output;
- protected:
-
- public:
- Input(const std::string &type, int appendix, const json &default_value,
- const std::function<bool(const json &)> &verification = [](
- const json &) { return true; });
- std::string setType(std::string type) override;
- std::string getType() override;
- std::string getID() override;
- std::string setPrefix(std::string prefix) override;
- std::string setAppendix(int appendix) override;
- state getState() override;
- void resetState() override;
- const json& getValue() override;
- std::shared_ptr<IOutput> getConnection() override;
- json& setDefaultValue() override;
- bool verify(const json & data) override;
- int addConnection(std::shared_ptr<IOutput> output) override;
- int removeConnection(std::shared_ptr<IOutput> output) override;
- bool connect(std::shared_ptr<IOutput> output) override;
- };
- }
- #endif //MDD_INPUT_H
|