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

common::Link Class Reference

Implementation of a multi-channel wavelength division multiplexed (WDM) link. More...

#include <link.h>

List of all members.

Public Member Functions

int assignChannel (u_long lightpath, u_int channel)
 Perform wavelength/channel assignment for an incoming lightpath request on a specified channel.

int assignChannel (u_long lightpath)
 Perform wavelength/channel assignment for an incoming lightpath request on any available channel.

int clearChannel (u_long lightpath)
 Explicit shutdown of a lightpath by calling clearChannel.

void getChannels (long *channels)
 Return the list of channel.

const u_int getChCount ()
 Get the channel count.

const u_int getDest ()
 Get the destination node.

const u_int getId ()
 Get the link specific identifier.

const u_int getSrc ()
 Get the source node.

bool isPresent (u_long lightpath)
 Checks to see if the lightpath is already made a reservation on the wavelength, this is mainly to disallow loops in the network.

 Link (u_int id, u_int src, u_int dest, u_int chCount)
 Construct a new Link object from the provided information.

std::string & toString ()
 Convert a representation of this object to a string object representation.

 ~Link ()
 Default destructor.


Private Attributes

u_int _chCount
 Represents the number of channels supported in by this link.

long * _chState
 Represents the state of the channels if equal to -1, then it is not used by any lightpath other a lightpath specific id is present.

std::string _descStr
 String representation of this object is used here.

u_int _dest
 Represents the destination node of the link.

u_int _id
 A unique link identifier.

u_int _src
 Represents the source node of the link.


Detailed Description

Implementation of a multi-channel wavelength division multiplexed (WDM) link.

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


Constructor & Destructor Documentation

common::Link::Link u_int  id,
u_int  src,
u_int  dest,
u_int  chCount
 

Construct a new Link object from the provided information.

Parameters:
id The unique link identifier
src The source node identifier
dest The destination node identifier
chCount The number of channels in that link.

common::Link::~Link  ) 
 

Default destructor.


Member Function Documentation

const u_int common::Link::getId  )  [inline]
 

Get the link specific identifier.

Returns:
the link identifier

const u_int common::Link::getSrc  )  [inline]
 

Get the source node.

Returns:
the source node of the link

const u_int common::Link::getDest  )  [inline]
 

Get the destination node.

Returns:
the destination node of this link

const u_int common::Link::getChCount  )  [inline]
 

Get the channel count.

Returns:
the channel count of this node

void common::Link::getChannels long *  channels  ) 
 

Return the list of channel.

Parameters:
the list of channels

int common::Link::assignChannel u_long  lightpath  ) 
 

Perform wavelength/channel assignment for an incoming lightpath request on any available channel.

NOTE: A first fit approach is used in this case.

Parameters:
lightpath A unique identifier of the lightpath
Returns:
A postive channel (or wavelength identifier) is returned. In case of error a value less than 0 is returned. -2 is returned if the lightpath is already present

int common::Link::assignChannel u_long  lightpath,
u_int  channel
 

Perform wavelength/channel assignment for an incoming lightpath request on a specified channel.

Parameters:
lightpath A unique identifier of the lightpath.
channel The specified channel to reserve the lightpath.
Returns:
A channel identifier is returned which is >0. A value <0 is is returned in case of error.

int common::Link::clearChannel u_long  lightpath  ) 
 

Explicit shutdown of a lightpath by calling clearChannel.

Parameters:
lightpath A unique identifier for the lightpath
Returns:
The channel identfier for which the lightpath was assigned -1 indicates no entry for lightpath was found -2 indicated multiple entries for this lightpath was found.

bool common::Link::isPresent u_long  lightpath  ) 
 

Checks to see if the lightpath is already made a reservation on the wavelength, this is mainly to disallow loops in the network.

Parameters:
lightpath,A unique identifier for the lightpath
Returns:
true If a lightpath is present, false is returned otherwise.

std::string& common::Link::toString  ) 
 

Convert a representation of this object to a string object representation.

Returns:
A string reference


Member Data Documentation

u_int common::Link::_id [private]
 

A unique link identifier.

u_int common::Link::_src [private]
 

Represents the source node of the link.

u_int common::Link::_dest [private]
 

Represents the destination node of the link.

long* common::Link::_chState [private]
 

Represents the state of the channels if equal to -1, then it is not used by any lightpath other a lightpath specific id is present.

u_int common::Link::_chCount [private]
 

Represents the number of channels supported in by this link.

std::string common::Link::_descStr [private]
 

String representation of this object is used here.


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