SubscriptionList * LocalNodeInfo::getConsolidatedSubscriptionsCopy (void) { SubscriptionList *pConsolidatedSubscriptionsCopy = new SubscriptionList(); if (pConsolidatedSubscriptionsCopy != NULL) { for (StringHashtable<Subscription>::Iterator i = _consolidatedSubscriptions.getIterator(); !i.end(); i.nextElement()) { pConsolidatedSubscriptionsCopy->addSubscription (i.getKey(), (i.getValue())->clone()); // Clone subscription before adding it } } return pConsolidatedSubscriptionsCopy; }
SubscriptionList * RemoteNodeInfo::getRemoteSubscriptionsCopy (void) { // Returns a copy of _pRemoteSubscriptions SubscriptionList *pRemoteSubscriptionsCopy = NULL; if (_pRemoteSubscriptions) { pRemoteSubscriptionsCopy = new SubscriptionList(); for (StringHashtable<Subscription>::Iterator i = _pRemoteSubscriptions->getIterator(); !i.end(); i.nextElement()) { pRemoteSubscriptionsCopy->addSubscription (i.getKey(), (i.getValue())->clone()); // Clone subscription before adding it } } return pRemoteSubscriptionsCopy; }