Public Member Functions | Private Attributes

LinkGraphJob::Node Class Reference

Link graph job node. More...

#include <linkgraphjob.h>

Inheritance diagram for LinkGraphJob::Node:
LinkGraph::ConstNode LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >

Public Member Functions

 Node (LinkGraphJob *lgj, NodeID node)
 Constructor.
Edge operator[] (NodeID to) const
 Retrieve an edge starting at this node.
EdgeIterator Begin () const
 Iterator for the "begin" of the edge array.
EdgeIterator End () const
 Iterator for the "end" of the edge array.
uint UndeliveredSupply () const
 Get amount of supply that hasn't been delivered, yet.
FlowStatMapFlows ()
 Get the flows running through this node.
const FlowStatMapFlows () const
 Get a constant version of the flows running through this node.
PathList & Paths ()
 Get the paths this node is part of.
const PathList & Paths () const
 Get a constant version of the paths this node is part of.
void DeliverSupply (NodeID to, uint amount)
 Deliver some supply, adding demand to the respective edge.

Private Attributes

NodeAnnotationnode_anno
 Annotation being wrapped.
EdgeAnnotationedge_annos
 Edge annotations belonging to this node.

Detailed Description

Link graph job node.

Wraps a constant link graph node and a modifiable node annotation.

Definition at line 182 of file linkgraphjob.h.


Constructor & Destructor Documentation

LinkGraphJob::Node::Node ( LinkGraphJob lgj,
NodeID  node 
) [inline]

Constructor.

Parameters:
lgj Job to take the node from.
node ID of the node.

Definition at line 193 of file linkgraphjob.h.


Member Function Documentation

EdgeIterator LinkGraphJob::Node::Begin (  )  const [inline]

Iterator for the "begin" of the edge array.

Only edges with capacity are iterated. The others are skipped.

Returns:
Iterator pointing to the first edge.

Reimplemented from LinkGraph::ConstNode.

Definition at line 211 of file linkgraphjob.h.

References edge_annos, LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::edges, and LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::index.

Referenced by LinkGraphJob::~LinkGraphJob().

void LinkGraphJob::Node::DeliverSupply ( NodeID  to,
uint  amount 
) [inline]

Deliver some supply, adding demand to the respective edge.

Parameters:
to Destination for supply.
amount Amount of supply to be delivered.

Definition at line 256 of file linkgraphjob.h.

References node_anno, and LinkGraphJob::NodeAnnotation::undelivered_supply.

EdgeIterator LinkGraphJob::Node::End (  )  const [inline]

Iterator for the "end" of the edge array.

Only edges with capacity are iterated. The others are skipped.

Returns:
Iterator pointing beyond the last edge.

Reimplemented from LinkGraph::ConstNode.

Definition at line 218 of file linkgraphjob.h.

References edge_annos, and LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::edges.

Referenced by LinkGraphJob::~LinkGraphJob().

FlowStatMap& LinkGraphJob::Node::Flows (  )  [inline]

Get the flows running through this node.

Returns:
Flows.

Definition at line 230 of file linkgraphjob.h.

References LinkGraphJob::NodeAnnotation::flows, and node_anno.

Referenced by LinkGraphJob::~LinkGraphJob().

const FlowStatMap& LinkGraphJob::Node::Flows (  )  const [inline]

Get a constant version of the flows running through this node.

Returns:
Flows.

Definition at line 236 of file linkgraphjob.h.

References LinkGraphJob::NodeAnnotation::flows, and node_anno.

Edge LinkGraphJob::Node::operator[] ( NodeID  to  )  const [inline]

Retrieve an edge starting at this node.

Mind that this returns an object, not a reference.

Parameters:
to Remote end of the edge.
Returns:
Edge between this node and "to".

Reimplemented from LinkGraph::ConstNode.

Definition at line 204 of file linkgraphjob.h.

References edge_annos, and LinkGraph::NodeWrapper< const BaseNode, const BaseEdge >::edges.

const PathList& LinkGraphJob::Node::Paths (  )  const [inline]

Get a constant version of the paths this node is part of.

Returns:
Paths.

Definition at line 249 of file linkgraphjob.h.

References node_anno, and LinkGraphJob::NodeAnnotation::paths.

PathList& LinkGraphJob::Node::Paths (  )  [inline]

Get the paths this node is part of.

Paths are always expected to be sorted so that those with flow == 0 are in the back of the list.

Returns:
Paths.

Definition at line 243 of file linkgraphjob.h.

References node_anno, and LinkGraphJob::NodeAnnotation::paths.

uint LinkGraphJob::Node::UndeliveredSupply (  )  const [inline]

Get amount of supply that hasn't been delivered, yet.

Returns:
Undelivered supply.

Definition at line 224 of file linkgraphjob.h.

References node_anno, and LinkGraphJob::NodeAnnotation::undelivered_supply.


The documentation for this class was generated from the following file: