ListenerCallbacks ListenerCallbacks::filter(CallbackId::Type type) const {
std::vector<CallbackId> filteredCallbackIds;
for (const auto& callbackId : callbackIds) {
if (callbackId.type == type) {
filteredCallbackIds.push_back(callbackId);
}
}
return ListenerCallbacks(transactionCompletedListener, filteredCallbackIds);
}
遍历成员 callbackIds
,过滤相同 type
的 CallbackId,新建一个 ListenerCallbacks 返回。