IBR-DTN  1.0.0
dtn::routing::NodeHandshake Class Reference

#include <NodeHandshake.h>

Collaboration diagram for dtn::routing::NodeHandshake:
Collaboration graph

Public Types

enum  MESSAGE_TYPE { HANDSHAKE_INVALID = 0, HANDSHAKE_REQUEST = 1, HANDSHAKE_RESPONSE = 2, HANDSHAKE_NOTIFICATION = 3 }
 
typedef std::set
< dtn::data::Number
request_set
 
typedef std::list
< NodeHandshakeItem * > 
item_set
 

Public Member Functions

 NodeHandshake ()
 
 NodeHandshake (MESSAGE_TYPE type, const dtn::data::Number &lifetime=60)
 
virtual ~NodeHandshake ()
 
void addRequest (const dtn::data::Number &identifier)
 
bool hasRequest (const dtn::data::Number &identifier) const
 
const request_setgetRequests () const
 
void addItem (NodeHandshakeItem *item)
 
bool hasItem (const dtn::data::Number &identifier) const
 
const item_setgetItems () const
 
MESSAGE_TYPE getType () const
 
const dtn::data::NumbergetLifetime () const
 
const std::string toString () const
 
template<class T >
T & get ()
 

Friends

std::ostream & operator<< (std::ostream &, const NodeHandshake &)
 
std::istream & operator>> (std::istream &, NodeHandshake &)
 

Detailed Description

Definition at line 92 of file NodeHandshake.h.

Member Typedef Documentation

Definition at line 104 of file NodeHandshake.h.

Definition at line 103 of file NodeHandshake.h.

Member Enumeration Documentation

Enumerator
HANDSHAKE_INVALID 
HANDSHAKE_REQUEST 
HANDSHAKE_RESPONSE 
HANDSHAKE_NOTIFICATION 

Definition at line 95 of file NodeHandshake.h.

Constructor & Destructor Documentation

dtn::routing::NodeHandshake::NodeHandshake ( )

Definition at line 28 of file NodeHandshake.cpp.

dtn::routing::NodeHandshake::NodeHandshake ( MESSAGE_TYPE  type,
const dtn::data::Number lifetime = 60 
)

Definition at line 33 of file NodeHandshake.cpp.

dtn::routing::NodeHandshake::~NodeHandshake ( )
virtual

Definition at line 38 of file NodeHandshake.cpp.

Member Function Documentation

void dtn::routing::NodeHandshake::addItem ( NodeHandshakeItem item)
template<class T >
T & dtn::routing::NodeHandshake::get ( )
const NodeHandshake::item_set & dtn::routing::NodeHandshake::getItems ( ) const

Definition at line 69 of file NodeHandshake.cpp.

const dtn::data::Number & dtn::routing::NodeHandshake::getLifetime ( ) const
const NodeHandshake::request_set & dtn::routing::NodeHandshake::getRequests ( ) const
NodeHandshake::MESSAGE_TYPE dtn::routing::NodeHandshake::getType ( ) const

Definition at line 101 of file NodeHandshake.cpp.

References dtn::data::SDNV< E >::get().

Referenced by dtn::routing::operator<<(), dtn::routing::operator>>(), dtn::routing::NodeHandshakeExtension::processHandshake(), and toString().

Here is the call graph for this function:

bool dtn::routing::NodeHandshake::hasItem ( const dtn::data::Number identifier) const

Definition at line 79 of file NodeHandshake.cpp.

References dtn::routing::NodeHandshakeItem::getIdentifier().

Here is the call graph for this function:

const std::string dtn::routing::NodeHandshake::toString ( ) const

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const NodeHandshake hs 
)
friend

Definition at line 163 of file NodeHandshake.cpp.

std::istream& operator>> ( std::istream &  stream,
NodeHandshake hs 
)
friend

Definition at line 208 of file NodeHandshake.cpp.


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