#ifndef __UT_ROBOT_SDK_SERVER_STUB_HPP__ #define __UT_ROBOT_SDK_SERVER_STUB_HPP__ #include #include #include #include namespace unitree { namespace robot { using ServerRequestHandler = std::function; class ServerStub { public: explicit ServerStub(); void Init(const std::string& name, const ServerRequestHandler& handler, bool enableProiQueue); bool Send(const Response& response); private: void Enqueue(const void* message); int32_t QueueThreadFunction(); int32_t ProiQueueThreadFunction(); private: bool mEnableProiQueue; ServerRequestHandler mRequestHandler; ChannelLaborPtr mChannelLaborPtr; common::BlockQueuePtr mQueuePtr; common::BlockQueuePtr mProiQueuePtr; common::ThreadPtr mQueueThreadPtr; common::ThreadPtr mProiQueueThreadPtr; }; using ServerStubPtr = std::shared_ptr; } } #endif//__UT_ROBOT_SDK_SERVER_STUB_HPP__