#include <Node.h>
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) |
| ConvergenceLayer * | getConvergenceLayer () 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 |
| ConvergenceLayer * | m_cl |
| pair< double, double > | m_position |
| dtn::core::Node::Node | ( | NodeType | type = PERMANENT, |
|
| unsigned int | rtt = 2700 | |||
| ) |
constructor
| type | set the node type |
| dtn::core::Node::Node | ( | const Node & | k | ) |
copy the object
| dtn::core::Node::~Node | ( | ) | [virtual] |
destructor
| NodeType dtn::core::Node::getType | ( | ) | const |
| void dtn::core::Node::setAddress | ( | string | address | ) |
Set the address of the node.
| 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.
References m_address.
Referenced by equals(), dtn::core::UDPConvergenceLayer::transmit(), and dtn::core::TCPConvergenceLayer::transmit().
| void dtn::core::Node::setPort | ( | unsigned int | port | ) |
References m_port.
Referenced by dtn::daemon::Configuration::getFakeBroadcastNodes(), dtn::daemon::Configuration::getStaticNodes(), and emma::EmmaConvergenceLayer::received().
| unsigned int dtn::core::Node::getPort | ( | ) | const |
References m_port.
Referenced by dtn::core::UDPConvergenceLayer::transmit(), and dtn::core::TCPConvergenceLayer::transmit().
| void dtn::core::Node::setDescription | ( | string | description | ) |
References m_description.
| string dtn::core::Node::getDescription | ( | ) | const |
| void dtn::core::Node::setURI | ( | string | uri | ) |
Set the URI (EID) of the node.
| 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 |
Get the URI (EID) of the node.
References m_uri.
Referenced by dtn::core::BundleRouter::discovered(), equals(), dtn::core::SimpleBundleStorage::eventNodeAvailable(), dtn::core::SimpleBundleStorage::eventNodeUnavailable(), dtn::core::EventDebugger::raiseEvent(), dtn::core::SimpleBundleStorage::tick(), dtn::core::TCPConvergenceLayer::transmit(), and emma::EmmaConvergenceLayer::yell().
| 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.
| timeout | The timeout in seconds. |
References m_timeout.
Referenced by emma::EmmaConvergenceLayer::received().
| int dtn::core::Node::getTimeout | ( | ) | const |
| 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>.
| step | Decrement the timeout by this value. |
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.
| node | A other node to compare. |
References getAddress(), and getURI().
Referenced by dtn::core::BundleRouter::isNeighbour().
| ConvergenceLayer * dtn::core::Node::getConvergenceLayer | ( | ) | const |
References m_cl.
Referenced by main(), dtn::core::MultiplexConvergenceLayer::transmit(), and dtn::core::BundleCore::transmit().
| void dtn::core::Node::setConvergenceLayer | ( | ConvergenceLayer * | cl | ) |
References m_cl.
Referenced by dtn::daemon::Configuration::getStaticNodes(), main(), and emma::EmmaConvergenceLayer::received().
| void dtn::core::Node::setPosition | ( | pair< double, double > | value | ) |
| pair< double, double > dtn::core::Node::getPosition | ( | ) | const |
References m_position.
string dtn::core::Node::m_address [private] |
Referenced by getAddress(), and setAddress().
string dtn::core::Node::m_description [private] |
Referenced by getDescription(), and setDescription().
string dtn::core::Node::m_uri [private] |
int dtn::core::Node::m_timeout [private] |
Referenced by decrementTimeout(), getTimeout(), and setTimeout().
unsigned int dtn::core::Node::m_rtt [private] |
Referenced by getRoundTripTime().
NodeType dtn::core::Node::m_type [private] |
Referenced by decrementTimeout(), and getType().
unsigned int dtn::core::Node::m_port [private] |
ConvergenceLayer* dtn::core::Node::m_cl [private] |
Referenced by getConvergenceLayer(), and setConvergenceLayer().
pair<double,double> dtn::core::Node::m_position [private] |
Referenced by getPosition(), and setPosition().
1.5.6