c_bool v_groupStreamSubscribeGroup( v_groupStream stream, v_group group) { c_bool inserted; assert(C_TYPECHECK(stream, v_groupStream)); assert(C_TYPECHECK(group, v_group)); if (v_reader(stream)->qos->durability.kind == v_topicQosRef(group->topic)->durability.kind) { struct groupMatched data; /* * OSPL-1073: Check if the new group matches with the group-expression list. This * is a collection of partition.topic strings that allows users to connect to specific * topics rather than connecting to all topics within a partition. */ if(stream->expr) { data.matched = FALSE; data.group = group; c_walk(stream->expr, (c_action)isGroupMatched, &data); }else { data.matched = TRUE; } if(data.matched) { inserted = v_groupAddStream(group, stream); if(inserted == TRUE){ c_insert(stream->groups, group); } } } return TRUE; }
c_bool v_groupStreamSubscribeGroup( v_groupStream stream, v_group group) { c_bool inserted; assert(C_TYPECHECK(stream, v_groupStream)); assert(C_TYPECHECK(group, v_group)); if (v_reader(stream)->qos->durability.kind == v_topicQosRef(group->topic)->durability.kind) { inserted = v_groupAddStream(group, stream); if(inserted == TRUE){ c_insert(stream->groups, group); } } return TRUE; }