Skip to content

Commit

Permalink
Adapt rtm 2.2.1 (#127)
Browse files Browse the repository at this point in the history
Some changes when adapting the RTM 2.2.1
  • Loading branch information
littleGnAl authored Aug 15, 2024
1 parent b024329 commit 5af4287
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 52 deletions.
9 changes: 5 additions & 4 deletions headers/rtm_2.2.1/custom_headers/CustomIAgoraRtmClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ namespace ext {

class IRtmClient {
// ----------------------------- 👇🏻new API👇🏻 -----------------------------

// IRtmClient
//virtual int publish(const char* channelName, const char* message, const size_t length, const PublishOptions& option, uint64_t& requestId) = 0;
virtual int publishWithBuffer(const char* channelName, const unsigned char* message, const size_t length, const PublishOptions& option, uint64_t& requestId) = 0;
/**
* @iris_api_id: RtmClient_publish_2d36e93
* @source: virtual void publish(const char* channelName, const char* message, const size_t length, const PublishOptions& option, uint64_t& requestId) = 0;
*/
virtual void publishBinaryMessage(const char* channelName, const unsigned char* message, const size_t length, const PublishOptions& option, uint64_t& requestId) = 0;

// ----------------------------- 👆🏻new API👆🏻 -----------------------------
};
Expand Down
34 changes: 0 additions & 34 deletions headers/rtm_2.2.1/custom_headers/CustomIAgoraRtmStorage.h

This file was deleted.

9 changes: 5 additions & 4 deletions headers/rtm_2.2.1/custom_headers/CustomIAgoraStreamChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ namespace ext {

class IStreamChannel {
// ----------------------------- 👇🏻new API👇🏻 -----------------------------

// IStreamChannel
//virtual int publishTopicMessage(const char* topic, const char* message, size_t length, const PublishOptions& option) = 0;
virtual int publishTopicMessageWithBuffer(const char* topic, const unsigned char* message, size_t length, const PublishOptions& option) = 0;
/**
* @iris_api_id: StreamChannel_publishTopicMessage_a31773e
* @source: virtual void publish(const char* channelName, const char* message, const size_t length, const PublishOptions& option, uint64_t& requestId) = 0;
*/
virtual void publishTopicBinaryMessage(const char* topic, const unsigned char* message, size_t length, const TopicMessageOptions& option, uint64_t& requestId) = 0;

// ----------------------------- 👆🏻new API👆🏻 -----------------------------
};
Expand Down
31 changes: 22 additions & 9 deletions src/parsers/pointer_marker_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,18 +136,31 @@ export function PointerMarkerParser(
parseResult.nodes.forEach((it) => {
let cxxFile = it as CXXFile;
cxxFile.nodes.forEach((node) => {
for (let marker of config.markers) {
let markerNode = marker.node;
if (checkObjInclude(node, markerNode)) {
node.user_data ??= {};
node.user_data!['PointerMarkerParser'] = {
pointerArrayNameMappings: marker.pointerArrayNameMappings ?? [],
pointerNames: marker.pointerNames ?? [],
};
}
applyPointerMarkerParserUserDataIfNeeded(config.markers, node);

if (node.isClazz()) {
node.asClazz().methods.forEach((method) => {
applyPointerMarkerParserUserDataIfNeeded(config.markers, method);
});
}
});
});

return parseResult;
}

function applyPointerMarkerParserUserDataIfNeeded(
markers: PointerMarkerParserConfigMarker[],
node: CXXTerraNode
) {
for (let marker of markers) {
let markerNode = marker.node;
if (checkObjInclude(node, markerNode)) {
node.user_data ??= {};
node.user_data!['PointerMarkerParser'] = {
pointerArrayNameMappings: marker.pointerArrayNameMappings ?? [],
pointerNames: marker.pointerNames ?? [],
};
}
}
}
4 changes: 3 additions & 1 deletion src/utils/obj_utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import _ from 'lodash';

/**
* Checks if a property in an object is equal to a given value.
* If the value is a string, it performs a regular expression test.
Expand All @@ -10,7 +12,7 @@ export function checkPropertyEq(obj: any, key: string, value: any): boolean {
function _arraysAreIdentical(arr1: any, arr2: any) {
if (arr1.length !== arr2.length) return false;
for (var i = 0, len = arr1.length; i < len; i++) {
if (arr1[i] !== arr2[i]) {
if (!_.isEqual(arr1[i], arr2[i])) {
return false;
}
}
Expand Down

0 comments on commit 5af4287

Please sign in to comment.