IBR-DTNSuite  0.8
dtn::core::Node Class Reference

#include <Node.h>

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, CONN_FILE = 6,
  CONN_DGRAM_UDP = 7, CONN_DGRAM_LOWPAN = 8, CONN_DGRAM_ETHERNET = 9
}
enum  Type {
  NODE_UNAVAILABLE = 0, NODE_CONNECTED = 1, NODE_DISCOVERED = 2, NODE_STATIC = 3,
  NODE_DHT_DISCOVERED = 4
}

Public Member Functions

 Node (const dtn::data::EID &id)
 Node ()
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::set< Node::TypegetTypes () 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 
CONN_FILE 
CONN_DGRAM_UDP 
CONN_DGRAM_LOWPAN 
CONN_DGRAM_ETHERNET 

Definition at line 26 of file Node.h.

Specify a node type. FLOATING is a node, if it's not statically reachable. STATIC is used for static nodes with are permanently reachable. DHT_DISCOVERED is used for a node, learned by a dht lookup

Enumerator:
NODE_UNAVAILABLE 
NODE_CONNECTED 
NODE_DISCOVERED 
NODE_STATIC 
NODE_DHT_DISCOVERED 

Definition at line 47 of file Node.h.


Constructor & Destructor Documentation

constructor

Parameters:
typeset the node type
See also:
NoteType

Definition at line 121 of file Node.cpp.

Definition at line 116 of file Node.cpp.

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

destructor

Definition at line 126 of file Node.cpp.


Member Function Documentation

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

Definition at line 218 of file Node.cpp.

Clear all URIs & Attributes contained in this node.

Definition at line 234 of file Node.cpp.

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

Definition at line 409 of file Node.cpp.

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

remove expired service descriptors

Returns:
True, if all attributes are gone

Definition at line 308 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 252 of file Node.cpp.

References dtn::core::compare_uri_priority().

Referenced by dtn::net::TCPConnection::connect(), dtn::net::LOWPANConvergenceLayer::queue(), dtn::net::UDPConvergenceLayer::queue(), dtn::net::DatagramConvergenceLayer::queue(), and dtn::daemon::DTNTPWorker::raiseEvent().

Here is the call graph for this function:

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

Definition at line 267 of file Node.cpp.

References dtn::core::compare_uri_priority().

Here is the call graph for this function:

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 288 of file Node.cpp.

References dtn::core::compare_attr_priority().

Here is the call graph for this function:

std::set< Node::Type > dtn::core::Node::getTypes ( ) const

Returns a set of all available types

Definition at line 278 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 194 of file Node.cpp.

Referenced by dtn::net::ConnectionManager::open(), dtn::daemon::DTNTPWorker::raiseEvent(), and dtn::net::FileConvergenceLayer::raiseEvent().

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

Definition at line 203 of file Node.cpp.

returns true, if at least one connection is available

Definition at line 419 of file Node.cpp.

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

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

Definition at line 352 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 369 of file Node.cpp.

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

Definition at line 396 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 391 of file Node.cpp.

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

Definition at line 386 of file Node.cpp.

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

Remove a given URI of the node.

Parameters:
proto

Definition at line 224 of file Node.cpp.

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

Definition at line 229 of file Node.cpp.

Definition at line 414 of file Node.cpp.

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

std::string dtn::core::Node::toString ( ) const

Definition at line 403 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 424 of file Node.cpp.


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