Exemplo n.º 1
0
void
BoostInfoTree::addSubtree
  (const string& treeName, ptr_lib::shared_ptr<BoostInfoTree> newTree)
{
  vector<ptr_lib::shared_ptr<BoostInfoTree> >* subtreeList = find(treeName);
  if (subtreeList)
    subtreeList->push_back(newTree);
  else {
    subtrees_.push_back(make_pair
      (treeName, vector<ptr_lib::shared_ptr<BoostInfoTree> >()));
    subtrees_.back().second.push_back(newTree);
  }

  newTree->parent_ = this;
  lastChild_ = newTree.get();
}
Exemplo n.º 2
0
void
Node::processInterestTimeout(ptr_lib::shared_ptr<PendingInterest> pendingInterest)
{
  if (pendingInterest->getIsRemoved())
    // extractEntriesForExpressedInterest or removePendingInterest has removed 
    // pendingInterest from pendingInterestTable_, so we don't need to look for
    // it. Do nothing.
    return;

  // Find the entry.
  for (vector<ptr_lib::shared_ptr<PendingInterest> >::iterator entry =
         pendingInterestTable_.begin();
       entry != pendingInterestTable_.end();
       ++entry) {
    if (entry->get() == pendingInterest.get()) {
      pendingInterestTable_.erase(entry);
      pendingInterest->callTimeout();
      return;
    }
  }

  // The pending interest has been removed. Do nothing.
}