dtn::core::BundleRouter Class Reference

#include <BundleRouter.h>

Inheritance diagram for dtn::core::BundleRouter:

dtn::utils::Service dtn::core::EventReceiver dtn::core::StaticBundleRouter

List of all members.

Public Member Functions

 BundleRouter (string eid)
virtual ~BundleRouter ()
virtual const list< Node > & getNeighbours ()
virtual bool isNeighbour (Node &node)
bool isNeighbour (string eid)
Node getNeighbour (string eid)
virtual void tick ()
virtual BundleSchedule getSchedule (const Bundle &b)
bool isLocal (const Bundle &b) const
void raiseEvent (const Event *evt)

Protected Member Functions

void terminate ()

Private Member Functions

virtual void discovered (const Node &node)

Private Attributes

list< Nodem_neighbours
string m_eid
dtn::utils::Mutex m_lock
Conditional m_nexttime


Detailed Description

A bundle router search a route for given bundle and return a BundleSchedule. Additional manage a list of currently reachable nodes.

This is a base class which can be extended to implement several routing protocols.


Constructor & Destructor Documentation

dtn::core::BundleRouter::BundleRouter ( string  eid  ) 

dtn::core::BundleRouter::~BundleRouter (  )  [virtual]


Member Function Documentation

const list< Node > & dtn::core::BundleRouter::getNeighbours (  )  [virtual]

Returns a list of currently reachable nodes.

Returns:
The list of currently reachable nodes.

References m_lock, and m_neighbours.

bool dtn::core::BundleRouter::isNeighbour ( Node node  )  [virtual]

Determine of a specific node is currently reachable.

Parameters:
node The node to reach.
Returns:
true, if the given node is reachable.

References dtn::core::Node::equals(), m_lock, and m_neighbours.

Referenced by dtn::core::StaticBundleRouter::getSchedule(), and getSchedule().

bool dtn::core::BundleRouter::isNeighbour ( string  eid  ) 

References m_lock, and m_neighbours.

Node dtn::core::BundleRouter::getNeighbour ( string  eid  ) 

References m_lock, and m_neighbours.

Referenced by raiseEvent().

void dtn::core::BundleRouter::tick (  )  [virtual]

BundleSchedule dtn::core::BundleRouter::getSchedule ( const Bundle b  )  [virtual]

Search for a route and return a schedule for the given bundle

Parameters:
b A bundle to route.
Returns:
A schedule for the given bundle.

Reimplemented in dtn::core::StaticBundleRouter.

References dtn::data::Bundle::getDestination(), dtn::data::Bundle::isExpired(), isLocal(), isNeighbour(), and m_eid.

Referenced by dtn::core::StaticBundleRouter::getSchedule(), and raiseEvent().

bool dtn::core::BundleRouter::isLocal ( const Bundle b  )  const

void dtn::core::BundleRouter::raiseEvent ( const Event evt  )  [virtual]

void dtn::core::BundleRouter::terminate (  )  [protected, virtual]

void dtn::core::BundleRouter::discovered ( const Node node  )  [private, virtual]

Updates the list of reachable nodes. If the node is currently unknown a NODE_AVAILABLE event will be raised.

Parameters:
node The node with new information.

References dtn::core::Node::getURI(), m_lock, m_neighbours, dtn::core::NODE_AVAILABLE, dtn::core::PERMANENT, and dtn::core::EventSwitch::raiseEvent().

Referenced by raiseEvent().


Member Data Documentation

Reimplemented in dtn::core::StaticBundleRouter.

Referenced by getSchedule(), and isLocal().

Referenced by raiseEvent(), terminate(), and tick().


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

Generated on Wed Mar 25 12:41:35 2009 for IBR-DTN by  doxygen 1.5.6