Example #1
0
//--------------------------------------------------------------------------------------------------------------------
void
Tree::remove (Tree::Edge* e)
  throw (Tree::NonexistentEdge, Tree::EmptyEdge)
{
  if (e == 0)
    throw EmptyEdge();
  if (edge_set.erase(e) == 0)
    throw NonexistentEdge(e);
  preorder_needed = postorder_needed = rpostorder_needed = true;
  e->in_use = false;
  deque_erase<Edge*>(e->parent_node->outgoing, e);
  e->child_node->incoming = 0;
}
Example #2
0
//--------------------------------------------------------------------
void
Tree::removeEdge (OA_ptr<Tree::Edge>  e)
  throw (Tree::NonexistentEdge, Tree::EmptyEdge)
{
  if (e.ptrEqual(0)) {
    throw EmptyEdge();
  }
  if (edge_set->erase(e) == 0) {
    throw NonexistentEdge(e);
  }
  preorder_needed = postorder_needed = rpostorder_needed = true;
  e->in_use = false;
  deque_erase<OA_ptr<Edge> >(*(e->parent_node->outgoing), e);
  e->child_node->incoming = 0;
}