NIM PC Cross Platform SDK
载入中...
搜索中...
未找到
nim_qchat_helper.h
浏览该文件的文档.
1
6#ifndef _NIM_SDK_CPP_NIM_QCHAT_SDK_LOADER_HELPER_H_
7#define _NIM_SDK_CPP_NIM_QCHAT_SDK_LOADER_HELPER_H_
8
10
11namespace nim {
13} // namespace nim
14
15template <typename C, typename R>
16static void InvokeCallback(const R* response) {
17 if (response && response->user_data != nullptr) {
18 auto cb = reinterpret_cast<C*>(response->user_data);
19 if (cb) {
20 if (*cb) {
21 (*cb)(*response);
22 }
23 delete cb;
24 }
25 }
26}
27
28// template <typename C, typename R>
29// static void InvokeCallback(const R* response) {
30// if (response != nullptr && response->user_data != nullptr) {
31// auto cb = reinterpret_cast<C*>(response->user_data);
32// if (cb) {
33// (*cb)(*response);
34// delete cb;
35// }
36// }
37// }
38
39#ifdef NIM_SDK_DLL_IMPORT
40#define NIM_QCHAT_SDK_GET_FUNC(function_ptr) NIM_SDK_GET_FUNC_FROM_INSTANCE(nim_sdk_instance, function_ptr)
41#else
42#define NIM_QCHAT_SDK_GET_FUNC(function_ptr) function_ptr
43#endif
44#endif // _NIM_SDK_CPP_NIM_QCHAT_SDK_LOADER_HELPER_H_
SDK库辅助类,提供加载/卸载SDK库以及获取接口的方法
Definition: nim_sdk_util.h:38
namespace nim
nim::SDKInstance * nim_sdk_instance
Definition: nim_qchat_helper.h:12
static void InvokeCallback(const R *response)
Definition: nim_qchat_helper.h:16
SDK库辅助方法