NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
nim_cpp_subscribe_event.h
浏览该文件的文档.
1
7#ifndef _NIM_SDK_CPP_SUBSCRIBE_EVENT_H_
8#define _NIM_SDK_CPP_SUBSCRIBE_EVENT_H_
9
10#include <functional>
11#include <list>
12#include <string>
15
20namespace nim {
25public:
27 typedef std::function<void(NIMResCode res_code, const nim::EventData& event_data)> PushEventCallback;
28 typedef std::function<void(NIMResCode res_code, const std::list<nim::EventData>& event_list)>
31
33 typedef std::function<void(NIMResCode res_code, int event_type, const nim::EventData& event_data)> PublishEventCallback;
34 typedef std::function<void(NIMResCode res_code, int event_type, const std::list<std::string>& faild_list)>
37 typedef std::function<void(NIMResCode res_code, int event_type, const std::list<std::string>& faild_list)>
41 typedef std::function<void(NIMResCode res_code, int event_type)> BatchUnSubscribeEventCallback;
42 typedef std::function<void(NIMResCode res_code, int event_type, const std::list<nim::EventSubscribeData>& subscribe_list)>
45 typedef std::function<void(NIMResCode res_code, int event_type, const std::list<nim::EventSubscribeData>& subscribe_list)>
48
49public:
57 static void RegPushEventCb(const PushEventCallback& cb, const std::string& json_extension = "");
58
66 static void RegBatchPushEventCb(const BatchPushEventCallback& cb, const std::string& json_extension = "");
67
80 static bool Publish(const EventData& event_data, const PublishEventCallback& cb, const std::string& json_extension = "");
81
100 static bool Subscribe(int event_type,
101 int64_t ttl,
103 const std::list<std::string>& accid_list,
104 const SubscribeEventCallback& cb,
105 const std::string& json_extension = "");
106
121 static bool UnSubscribe(int event_type,
122 const std::list<std::string>& accid_list,
123 const UnSubscribeEventCallback& cb,
124 const std::string& json_extension = "");
125
136 static bool BatchUnSubscribe(int event_type, const BatchUnSubscribeEventCallback& cb, const std::string& json_extension = "");
137
152 static bool QuerySubscribe(int event_type,
153 const std::list<std::string>& accid_list,
155 const std::string& json_extension = "");
156};
157
158} // namespace nim
159
160#endif //_NIM_SDK_CPP_SUBSCRIBE_EVENT_H_
NIM 订阅事件相关接口
Definition: nim_cpp_subscribe_event.h:24
std::function< void(NIMResCode res_code, int event_type, const std::list< nim::EventSubscribeData > &subscribe_list)> BatchQuerySubscribeEventCallback
查询指定事件的全部订阅关系回调模板
Definition: nim_cpp_subscribe_event.h:47
std::function< void(NIMResCode res_code, int event_type, const std::list< nim::EventSubscribeData > &subscribe_list)> QuerySubscribeEventCallback
按帐号查询指定事件的订阅关系回调模板
Definition: nim_cpp_subscribe_event.h:44
std::function< void(NIMResCode res_code, const nim::EventData &event_data)> PushEventCallback
接收订阅事件回调模板
Definition: nim_cpp_subscribe_event.h:27
std::function< void(NIMResCode res_code, int event_type, const nim::EventData &event_data)> PublishEventCallback
发布事件回调模板
Definition: nim_cpp_subscribe_event.h:33
std::function< void(NIMResCode res_code, int event_type, const std::list< std::string > &faild_list)> UnSubscribeEventCallback
按账号取消指定事件的订阅关系回调模板
Definition: nim_cpp_subscribe_event.h:39
std::function< void(NIMResCode res_code, int event_type, const std::list< std::string > &faild_list)> SubscribeEventCallback
订阅事件回调模板
Definition: nim_cpp_subscribe_event.h:36
std::function< void(NIMResCode res_code, const std::list< nim::EventData > &event_list)> BatchPushEventCallback
批量接收订阅事件回调模板
Definition: nim_cpp_subscribe_event.h:30
std::function< void(NIMResCode res_code, int event_type)> BatchUnSubscribeEventCallback
取消指定事件的全部订阅关系回调模板
Definition: nim_cpp_subscribe_event.h:41
namespace nim
定义导出宏
#define NIM_SDK_CPPWRAPPER_DLL_API
Definition: nim_sdk_cpp_wrapper.h:38
NIMEventSubscribeSyncEventType
Definition: nim_subscribe_event_def.h:95
事件订阅辅助方法和数据结构定义
NIMResCode
Definition: public_defines.h:21
事件数据
Definition: nim_subscribe_event_helper.h:24