5 #ifndef CORELINKCALLBACK_H 6 #define CORELINKCALLBACK_H 11 inline void Callback::RecvCallback(STREAM_ID recvID, STREAM_ID sendID,
const char* msg,
int jsonLen,
int msgLen,
void* callback) {
13 if (callbackFunc ==
nullptr) {
return; }
14 callbackFunc->
Func(
RecvData(recvID, sendID, msg, jsonLen, msgLen));
32 ((
CallbackData*)callback)->func(recvID, sendID, msg + jsonLen, msgLen);
67 rapidjson::Document json;
76 rapidjson::Document json;
79 json.Parse(msg, jsonLen);
81 ((
CallbackDataJson*)callback)->func(recvID, sendID, msg + jsonLen, msgLen, json);
98 rapidjson::Document json;
100 if (recvData.
hdrLen > 0) {
107 rapidjson::Document json;
110 json.Parse(msg, jsonLen);
Defines the classes in the wrapper and their relations.
static void RecvCallback(STREAM_ID recvID, STREAM_ID sendID, const char *msg, int jsonLen, int msgLen, void *callback)
void Func(const RecvData &recvData) override
static void RecvCallback(STREAM_ID recvID, STREAM_ID sendID, const char *msg, int jsonLen, int msgLen, void *callback)
static void RecvCallback(STREAM_ID recvID, STREAM_ID sendID, const char *msg, int jsonLen, int msgLen, void *callback)
void Func(const RecvData &recvData) override
virtual void Func(const RecvData &recvData)=0
CallbackDataJsonVoid(void(*func)(void *, const STREAM_ID &, const STREAM_ID &, const char *, const int &, const rapidjson::Document &), void *obj)
CallbackDataVoid(void(*func)(void *, const STREAM_ID &, const STREAM_ID &, const char *, const int &), void *obj)
void Func(const RecvData &recvData) override
static void RecvCallback(STREAM_ID recvID, STREAM_ID sendID, const char *msg, int jsonLen, int msgLen, void *callback)
CallbackDataJson(void(*func)(const STREAM_ID &, const STREAM_ID &, const char *, const int &, const rapidjson::Document &))
CallbackData(void(*func)(const STREAM_ID &, const STREAM_ID &, const char *, const int &))
void Func(const RecvData &recvData) override
static void RecvCallback(STREAM_ID recvID, STREAM_ID sendID, const char *msg, int jsonLen, int msgLen, void *callback)