ModuleHTTP.h 597 B

12345678910111213141516171819202122232425262728
  1. #ifndef MDD_MODULEHTTP_H
  2. #define MDD_MODULEHTTP_H
  3. #include "ModuleBase.h"
  4. #include <httplib.h>
  5. using namespace httplib;
  6. namespace mdd{
  7. class ModuleHTTP : public ModuleBase{
  8. private:
  9. std::string _fname;
  10. std::string _id;
  11. int _port;
  12. protected:
  13. bool connect();
  14. std::string str_to_json(const std::string& input);
  15. bool updateInputs();
  16. bool updateOutputs();
  17. void updateLayout();
  18. public:
  19. ModuleHTTP(std::string fname, std::string id, int port);
  20. bool update() override;
  21. };
  22. }
  23. #endif //MDD_MODULEHTTP_H