#pragma once #include "pahoc/mqtt_async.h" #include "tool/log.hpp" #include "net_message_trans.h" #ifdef ENABLE_TENSORRT_DETECT #include "tensorrt_detect/wheel-detector.h" #else #include "onnx_detect/wheel-detector.h" #endif class YoloSegmentMqttAsyncClient : public MqttAsyncClient { friend class MqttAsyncClient; public: static YoloSegmentMqttAsyncClient *iter() { static YoloSegmentMqttAsyncClient *instance = nullptr; if (instance == nullptr) { instance = new YoloSegmentMqttAsyncClient(); } return instance; } void init(const std::string &file); protected: private: YoloSegmentMqttAsyncClient() = default; static int CloudDataArrived(void *client, char *topicName, int topicLen, MQTTAsync_message *message); public: TensorrtWheelDetector *detector = nullptr; private: };