MCPcopy Create free account
hub / github.com/Tencent/phxqueue / GetSubIDsByPubID

Method GetSubIDsByPubID

phxqueue/config/topicconfig.cpp:259–270  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259comm::RetCode TopicConfig::GetSubIDsByPubID(const int pub_id, set<int> &sub_ids) const {
260 sub_ids.clear();
261
262 comm::RetCode ret;
263 shared_ptr<const proto::Pub> pub;
264 if (comm::RetCode::RET_OK != (ret = GetPubByPubID(pub_id, pub))) return ret;
265 if (!pub) return comm::RetCode::RET_ERR_RANGE_PUB;
266 for (int i{0}; i < pub->sub_ids_size(); ++i) {
267 sub_ids.insert(pub->sub_ids(i));
268 }
269 return comm::RetCode::RET_OK;
270}
271
272/******************* sub ********************/
273comm::RetCode TopicConfig::GetAllSub(vector<shared_ptr<const proto::Sub>> &subs) const {

Callers 2

CheckTopicConfigMethod · 0.80
TestTopicConfigMethod · 0.80

Calls

no outgoing calls

Tested by 2

CheckTopicConfigMethod · 0.64
TestTopicConfigMethod · 0.64