Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

sim::RouteManager Class Reference

The RouteManager provides a unified interface to adding and deleting routes between nodes in the simulated topology. More...

#include <routedb.h>

List of all members.

Public Member Functions

void addRoute (u_int src, u_int dest, u_int rtSize, int *rt)
 Add a route to the specified node's database.

int * getRoute (u_int src, u_int dest)
 Search the route tables for any existing route between the source and destination.

u_int getRouteSize (u_int src, u_int dest)
 Get the route size for the existing route between the source and destination.

 RouteManager (u_int size)
 Construct a new RouteManager object of the provided size.


Static Public Member Functions

void parseRouteFile (RouteManager *rm, std::string filename)
 Parse an input route file and populate the route manager.


Protected Attributes

Routedb_rdb
 An instance of the route database.

u_int _size
 Size of the route database - one for every node.


Detailed Description

The RouteManager provides a unified interface to adding and deleting routes between nodes in the simulated topology.

The class is essentially an implementation of a simple heirarchical database of all routes between a node and other possible destinations. Output from a routing process can store the computed routes in this database.

Author:
Rama Shenai
Version:
1.0 05/20/2004


Constructor & Destructor Documentation

sim::RouteManager::RouteManager u_int  size  ) 
 

Construct a new RouteManager object of the provided size.

Parameters:
size Number of nodes in the network.


Member Function Documentation

void sim::RouteManager::addRoute u_int  src,
u_int  dest,
u_int  rtSize,
int *  rt
 

Add a route to the specified node's database.

Parameters:
src The specified source node to which the route will be added
dest The destination node
rtSize The size of routes in terms of the number of nodes involved and not the number of hops. Hence rtSize = hop_count + 1
rt The route

int* sim::RouteManager::getRoute u_int  src,
u_int  dest
 

Search the route tables for any existing route between the source and destination.

Parameters:
src The source node
dest The destination node
Returns:
A valid route. NULL in case of no route or error.

u_int sim::RouteManager::getRouteSize u_int  src,
u_int  dest
 

Get the route size for the existing route between the source and destination.

Parameters:
src The source node
dest The destination node
Returns:
The route size in the number of hops. (0 if no route exists)

void sim::RouteManager::parseRouteFile RouteManager rm,
std::string  filename
[static]
 

Parse an input route file and populate the route manager.

An example format of the route file is as follows (For example, a route between 0 and 8 between 5 and 3

 0 8 4 4 0 5 3 8 

Parameters:
rm A pointer an already created RouteManager object
filename THe input route file


Member Data Documentation

Routedb* sim::RouteManager::_rdb [protected]
 

An instance of the route database.

u_int sim::RouteManager::_size [protected]
 

Size of the route database - one for every node.


The documentation for this class was generated from the following file:
Generated on Fri May 21 15:23:22 2004 for Optical Network Simulation (Build) by doxygen 1.3.7