#ifndef MDD_IModule_H
#define MDD_IModule_H

#include "IOutput.h"
#include "IInput.h"
#include "IManager.h"
#include "state.h"
#include <string>
#include <vector>
#include <memory>

namespace mdd {
    class IModule
        : public IUnique
        , public IManager
        , public std::enable_shared_from_this<IModule>
    {
    public:
        typedef std::shared_ptr<IModule> Ptr;

        virtual size_t getNumInputs() = 0;
        virtual size_t getNumOutputs() = 0;
        //"Processor1/Math1/Value1"
        //Proc2/MAth1;Value1
        //Proc2->get(MAth1;Value1)

        //MAth1;Value1
        //MAth1->get(Value1)
        //Value1
        virtual std::shared_ptr<IInput> getInput(const json& jid) = 0;
        virtual std::shared_ptr<IInput> getInput(size_t index) = 0;
        virtual std::shared_ptr<IOutput> getOutput(const json& jid) = 0;
        virtual std::shared_ptr<IOutput> getOutput(size_t index) = 0;

        virtual std::vector<std::shared_ptr<IInput>> getOptimizableInputs() = 0;
        virtual std::vector<std::shared_ptr<IOutput>> getOptimizableOutputs() = 0;

        //virtual std::vector <std::vector <std::shared_ptr<IInput>>> getConnectionsOf(Input) = 0;
        //virtual std::vector <std::shared_ptr<IInput>> getOptimizable() = 0;

        virtual state update() = 0;
        virtual void disconnect() = 0;
        virtual ~IModule() = default;
    };
}
#endif
