dtn::core::Node Class Reference

#include <Node.h>

List of all members.

Public Member Functions

 Node (NodeType type=PERMANENT, unsigned int rtt=2700)
 Node (const Node &k)
virtual ~Node ()
NodeType getType () const
void setAddress (string address)
string getAddress () const
void setPort (unsigned int port)
unsigned int getPort () const
void setDescription (string description)
string getDescription () const
void setURI (string uri)
string getURI () const
void setTimeout (int timeout)
int getTimeout () const
unsigned int getRoundTripTime () const
bool decrementTimeout (int step)
bool equals (Node &node)
ConvergenceLayergetConvergenceLayer () const
void setConvergenceLayer (ConvergenceLayer *cl)
void setPosition (pair< double, double > value)
pair< double, double > getPosition () const

Private Attributes

string m_address
string m_description
string m_uri
int m_timeout
unsigned int m_rtt
NodeType m_type
unsigned int m_port
ConvergenceLayerm_cl
pair< double, double > m_position


Detailed Description

A Node instance holds all informations of a neighboring node.

Constructor & Destructor Documentation

dtn::core::Node::Node ( NodeType  type = PERMANENT,
unsigned int  rtt = 2700 
)

constructor

Parameters:
type set the node type
See also:
NoteType

dtn::core::Node::Node ( const Node k  ) 

copy the object

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

destructor


Member Function Documentation

NodeType dtn::core::Node::getType (  )  const

get the node type.

Returns:
The type of the node.
See also:
NoteType

References m_type.

void dtn::core::Node::setAddress ( string  address  ) 

Set the address of the node.

Parameters:
address The address of the node. (e.g. 10.0.0.1 for IP)

References m_address.

Referenced by dtn::daemon::Configuration::getFakeBroadcastNodes(), dtn::daemon::Configuration::getStaticNodes(), and emma::EmmaConvergenceLayer::received().

string dtn::core::Node::getAddress (  )  const

Get the address of the node.

Returns:
The address of the node. (e.g. 10.0.0.1 for IP)

References m_address.

Referenced by equals(), dtn::core::UDPConvergenceLayer::transmit(), and dtn::core::TCPConvergenceLayer::transmit().

void dtn::core::Node::setPort ( unsigned int  port  ) 

unsigned int dtn::core::Node::getPort (  )  const

void dtn::core::Node::setDescription ( string  description  ) 

References m_description.

string dtn::core::Node::getDescription (  )  const

Get the assigned description for the node.

Returns:
The description.

References m_description.

void dtn::core::Node::setURI ( string  uri  ) 

Set the URI (EID) of the node.

Parameters:
uri The URI of the node.

References m_uri.

Referenced by dtn::daemon::Configuration::getStaticNodes(), and emma::EmmaConvergenceLayer::received().

string dtn::core::Node::getURI (  )  const

void dtn::core::Node::setTimeout ( int  timeout  ) 

Set the timeout of the node. This is only relevant if the node is of type FLOATING. The node get expired if the timeout if count to zero.

Parameters:
timeout The timeout in seconds.

References m_timeout.

Referenced by emma::EmmaConvergenceLayer::received().

int dtn::core::Node::getTimeout (  )  const

Get the current timeout.

Returns:
The timeout in seconds.

References m_timeout.

unsigned int dtn::core::Node::getRoundTripTime (  )  const

Get the roundtrip time for this contact

References m_rtt.

Referenced by dtn::core::BundleCore::transmit().

bool dtn::core::Node::decrementTimeout ( int  step  ) 

Decrement the timeout by <step>.

Parameters:
step Decrement the timeout by this value.
Returns:
false, if the timeout steps below zero. Timeout is reached.

References m_timeout, m_type, and dtn::core::PERMANENT.

Referenced by dtn::core::BundleRouter::tick().

bool dtn::core::Node::equals ( Node node  ) 

Compare this node to another one. Two nodes are equal if the uri and address of both nodes are equal.

Parameters:
node A other node to compare.
Returns:
true, if the given node is equal to this node.

References getAddress(), and getURI().

Referenced by dtn::core::BundleRouter::isNeighbour().

ConvergenceLayer * dtn::core::Node::getConvergenceLayer (  )  const

void dtn::core::Node::setConvergenceLayer ( ConvergenceLayer cl  ) 

void dtn::core::Node::setPosition ( pair< double, double >  value  ) 

pair< double, double > dtn::core::Node::getPosition (  )  const

References m_position.


Member Data Documentation

string dtn::core::Node::m_address [private]

Referenced by getAddress(), and setAddress().

Referenced by getDescription(), and setDescription().

string dtn::core::Node::m_uri [private]

Referenced by getURI(), and setURI().

unsigned int dtn::core::Node::m_rtt [private]

Referenced by getRoundTripTime().

Referenced by decrementTimeout(), and getType().

unsigned int dtn::core::Node::m_port [private]

Referenced by getPort(), and setPort().

pair<double,double> dtn::core::Node::m_position [private]

Referenced by getPosition(), and setPosition().


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

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