#ifndef MDD_INPUT_H
#define MDD_INPUT_H

#include <string>
#include <functional>
#include "Output.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;

    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;

        const json& getValue() override;
        json& setDefaultValue() override;
        bool verify(const json & data) override;
        bool connect(std::shared_ptr<IOutput> output) override;

    };
}

#endif //MDD_INPUT_H
