12345678910111213141516171819202122232425262728293031323334353637383940 |
- #ifndef MDD_MODULEHTTP_H
- #define MDD_MODULEHTTP_H
- #include "ModuleBase.h"
- #include <httplib.h>
- #include <memory>
- namespace boost {
- namespace process{
- class child;
- }
- };
- using namespace boost::process;
- using namespace httplib;
- namespace mdd{
- class ModuleHTTP : public ModuleBase{
- private:
- std::string _fname;
- std::string _id;
- int _port;
- std::unique_ptr<child> _child;
- protected:
- bool connect();
- std::string str_to_json(const std::string& input);
- state updateInputs();
- state updateOutputs();
- void updateLayout();
- public:
- ModuleHTTP(std::string fname, std::string id, int port);
- ~ModuleHTTP();
- state update() override;
- };
- }
- #endif //MDD_MODULEHTTP_H
|