class Node


 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

typedef map <A, Edge<A> > adjacency

adjacency

typedef ref_ptr<Node<A> > NodeRef

NodeRef

 Node (A a, bool trace = false)

Node

A  nodename ()

nodename

Returns: nodename

bool  add_edge (NodeRef dst, int weight)

add_edge

Add a new edge.

Returns: true on success. false if edge already exists.

bool  update_edge_weight (NodeRef dst, int weight)

update_edge_weight

Update edge weight.

Returns: true on success, false if the edge doesn't exist.

bool  get_edge_weight (NodeRef dst, int& weight)

get_edge_weight

Get edge weight.

Returns: true on success, false if the edge doesn't exist.

bool  remove_edge (NodeRef dst)

remove_edge

Remove an edge

void  drop_adjacencies ()

drop_adjacencies

Drop all adjacencies. Used to revive invalid nodes.

void  garbage_collect ()

garbage_collect

Remove all edges that point at invalid nodes.

void  set_valid (bool p)

set_valid

Set the valid state.

bool  valid ()

valid

Returns: true if this node is not marked for deletion.

void  set_tentative (bool p)

set_tentative

Set the tentative state.

bool  tentative ()

tentative

Get the tentative state.

void  invalidate_weights ()

invalidate_weights

Invalidate the weights.

bool  valid_weight ()

valid_weight

Is the current entry valid.

void  set_adjacent_weights (NodeRef me, int delta_weight, PriorityQueue<A>& tentative)

set_adjacent_weights

Set weights. Visit all neighbours that are tentative and add this weight.

Parameters:

delta_weightto add to this node.
tentativeadd all updated adjacent nodes to the tentative set.
bool  set_local_weight (int weight)

set_local_weight

Set local weight. Set the weight on this node if its tentative and less than the previous value.

Returns: true if its accepted.

int  get_local_weight ()

get_local_weight

get local weight.

void  set_first_hop (NodeRef n)

set_first_hop

The first hop to this node.

NodeRef  get_first_hop ()

get_first_hop

The first hop to this node.

void  set_last_hop (NodeRef n)

set_last_hop

The node before this.

NodeRef  get_last_hop ()

get_last_hop

The node before this.

bool  delta (RouteCmd<A>& rcmd)

delta

Return the difference between this computation and the last.

Parameters:

rcmdthe new route to this node if it has changed.

Returns: true if the node has changed.

void  clear ()

clear

Clear all the references to other nodes as well as possible references to ourselves.

string  pp ()

pp

[const]

Pretty print this node with its adjacencies

string  str ()

str

[const]

Returns: C++ string with the human-readable ASCII representation of the node.


Generated by: pavlin on possum.icir.org on Wed Mar 21 11:22:49 2007, using kdoc $.