#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;

        std::vector<double> _value;
        //std::function<bool(const json &)> _verification;
        std::shared_ptr <IOutput> _output;
        bool _optimizable;
        limits _limit;
    protected:
       

    public:
        Input(const std::string &type, int appendix, const std::vector<double>& default_value);
        //const std::function<bool(const json &)> &verification = [](const json&) { return true; }
        std::string setType(const std::string& type) override;
        std::string getType() override;
        std::string getID() override;
        std::string setPrefix(const std::string& prefix) override;
        std::string setAppendix(int appendix) override;

        state getState() override;
        void resetState() override;

        const std::vector<double>& getValue() override;
        std::vector<double>& setValue() override;
        state setValue(const std::vector<double>& val) override;
        bool isOptimizable() override;
        void setOptimizability(bool state) override;

        const limits& getLimits() override;
        limits& setLimits() override;

        std::shared_ptr<IOutput> getConnection() 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
