IBR-DTNSuite 0.6

dtn::core::Node Class Reference

#include <Node.h>

Collaboration diagram for dtn::core::Node:

List of all members.

Classes

class  Attribute
class  URI

Public Types

enum  Protocol {
  CONN_UNSUPPORTED = -1, CONN_UNDEFINED = 0, CONN_TCPIP = 1, CONN_UDPIP = 2,
  CONN_LOWPAN = 3, CONN_BLUETOOTH = 4, CONN_HTTP = 5
}
enum  Type { NODE_UNAVAILABLE = 0, NODE_CONNECTED = 1, NODE_DISCOVERED = 2, NODE_STATIC = 3 }

Public Member Functions

 Node (const dtn::data::EID &id)
virtual ~Node ()
bool has (Node::Protocol proto) const
bool has (const std::string &name) const
void add (const URI &u)
void add (const Attribute &attr)
void remove (const URI &u)
void remove (const Attribute &attr)
void clear ()
std::list< URIget (Node::Protocol proto) const
std::list< URIget (Node::Type type, Node::Protocol proto) const
std::list< Attributeget (const std::string &name) const
const dtn::data::EIDgetEID () const
bool expire ()
bool operator== (const Node &other) const
bool operator< (const Node &other) const
bool operator== (const dtn::data::EID &other) const
const Nodeoperator+= (const Node &other)
const Nodeoperator-= (const Node &other)
std::string toString () const
bool doConnectImmediately () const
void setConnectImmediately (bool val)
bool isAvailable () const

Static Public Member Functions

static std::string toString (Node::Type type)
static std::string toString (Node::Protocol proto)

Friends

std::ostream & operator<< (std::ostream &, const Node &)

Detailed Description

A Node instance holds all informations of a neighboring node.

Definition at line 23 of file Node.h.


Member Enumeration Documentation

Enumerator:
CONN_UNSUPPORTED 
CONN_UNDEFINED 
CONN_TCPIP 
CONN_UDPIP 
CONN_LOWPAN 
CONN_BLUETOOTH 
CONN_HTTP 

Definition at line 26 of file Node.h.

Specify a node type. FLOATING is a node, if it's not statically reachable. PERMANENT is used for static nodes with are permanently reachable.

Enumerator:
NODE_UNAVAILABLE 
NODE_CONNECTED 
NODE_DISCOVERED 
NODE_STATIC 

Definition at line 42 of file Node.h.


Constructor & Destructor Documentation

dtn::core::Node::Node ( const dtn::data::EID id)

constructor

Parameters:
typeset the node type
See also:
NoteType

Definition at line 116 of file Node.cpp.

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

destructor

Definition at line 121 of file Node.cpp.


Member Function Documentation

void dtn::core::Node::add ( const URI u)

Add a URI to this node.

Parameters:
u

Definition at line 192 of file Node.cpp.

Referenced by dtn::daemon::Configuration::Network::load(), operator+=(), and dtn::net::TCPConnection::setup().

void dtn::core::Node::add ( const Attribute attr)

Definition at line 198 of file Node.cpp.

void dtn::core::Node::clear ( )

Clear all URIs & Attributes contained in this node.

Definition at line 214 of file Node.cpp.

Referenced by dtn::net::TCPConnection::setup().

bool dtn::core::Node::doConnectImmediately ( ) const

Definition at line 360 of file Node.cpp.

Referenced by dtn::net::ConnectionManager::raiseEvent().

bool dtn::core::Node::expire ( )

remove expired service descriptors

Returns:
True, if all attributes are gone

Definition at line 259 of file Node.cpp.

References dtn::core::Node::URI::expire, dtn::core::Node::Attribute::expire, and dtn::utils::Clock::getTime().

Here is the call graph for this function:

std::list< Node::URI > dtn::core::Node::get ( Node::Protocol  proto) const

Returns a list of URIs matching the given protocol

Parameters:
proto
Returns:

Definition at line 220 of file Node.cpp.

Referenced by dtn::net::UDPConvergenceLayer::queue(), dtn::net::LOWPANConvergenceLayer::queue(), and dtn::net::TCPConnection::setup().

std::list< Node::URI > dtn::core::Node::get ( Node::Type  type,
Node::Protocol  proto 
) const

Definition at line 230 of file Node.cpp.

std::list< Node::Attribute > dtn::core::Node::get ( const std::string &  name) const

get a list of attributes match the given name

Parameters:
name
Returns:

Definition at line 240 of file Node.cpp.

bool dtn::core::Node::has ( Node::Protocol  proto) const

Check if the protocol is available for this node.

Parameters:
proto
Returns:

Definition at line 174 of file Node.cpp.

Referenced by dtn::net::ConnectionManager::open().

bool dtn::core::Node::has ( const std::string &  name) const

Definition at line 183 of file Node.cpp.

bool dtn::core::Node::isAvailable ( ) const

returns true, if at least one connection is available

Definition at line 370 of file Node.cpp.

Referenced by dtn::net::ConnectionManager::getNeighbors(), and dtn::net::ConnectionManager::isNeighbor().

const Node & dtn::core::Node::operator+= ( const Node other)

Definition at line 303 of file Node.cpp.

References add().

Here is the call graph for this function:

const Node & dtn::core::Node::operator-= ( const Node other)

Definition at line 320 of file Node.cpp.

bool dtn::core::Node::operator< ( const Node other) const

Definition at line 347 of file Node.cpp.

bool dtn::core::Node::operator== ( const dtn::data::EID other) const

Definition at line 337 of file Node.cpp.

bool dtn::core::Node::operator== ( const Node other) const

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

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

Definition at line 342 of file Node.cpp.

void dtn::core::Node::remove ( const URI u)

Remove a given URI of the node.

Parameters:
proto

Definition at line 204 of file Node.cpp.

void dtn::core::Node::remove ( const Attribute attr)

Definition at line 209 of file Node.cpp.

void dtn::core::Node::setConnectImmediately ( bool  val)

Definition at line 365 of file Node.cpp.

Referenced by dtn::daemon::Configuration::Network::load().

std::string dtn::core::Node::toString ( Node::Protocol  proto) [static]
std::string dtn::core::Node::toString ( ) const

Definition at line 354 of file Node.cpp.

References getEID(), and dtn::data::EID::getString().

Referenced by dtn::core::operator<<().

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Node node 
) [friend]

Definition at line 375 of file Node.cpp.


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