#ifndef MDD_MODULEHTTP_H
#define MDD_MODULEHTTP_H

#include "ModuleBase.h"
#include <httplib.h>
#include <boost/process.hpp>
using namespace boost::process;


using namespace httplib;

namespace mdd{
    class ModuleHTTP : public ModuleBase{
    private:
        std::string _fname;
        std::string _id;
        int _port;
        child _child;

    protected:
        bool connect();
        std::string str_to_json(const std::string& input);
        bool updateInputs();
        bool updateOutputs();
        void updateLayout();

    public:
        ModuleHTTP(std::string fname, std::string id, int port);
        ~ModuleHTTP();
        bool update() override;
    };
}

#endif //MDD_MODULEHTTP_H
