ZMQClient.hh 699 B

12345678910111213141516171819202122232425
  1. #pragma once
  2. #include "zmq.hpp"
  3. #include "opencv2/opencv.hpp"
  4. class ZMQClient
  5. {
  6. public:
  7. bool cancel;
  8. ZMQClient();
  9. ~ZMQClient();
  10. void connect(std::string address);
  11. std::string receiveMessage();
  12. // the sendMore parameter determines, whether this message is part of a multi-part-message
  13. std::string sendMessageToServer(const void *messageData, int messageLength, bool sendMore);
  14. std::string sendStringToServer(std::string messageStr, bool sendMore);
  15. std::string sendStringsToServer(std::vector<std::string> messages, bool sendMore);
  16. std::string sendImageToServer(cv::Mat image, bool sendMore);
  17. private:
  18. std::string addr;
  19. zmq::context_t context;
  20. zmq::socket_t socket;
  21. };