NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::Transport Class Referenceabstract

#include <transport.hpp>

Inheritance diagram for ndn::Transport:
Collaboration diagram for ndn::Transport:

Classes

class  Error
 

Public Types

typedef function< void(const Block &wire)> ReceiveCallback
 
typedef function< void()> ErrorCallback
 

Public Member Functions

 Transport ()
 
virtual ~Transport ()
 
virtual void connect (boost::asio::io_service &io_service, const ReceiveCallback &receiveCallback)
 Connect transport. More...
 
virtual void close ()=0
 Close the connection. More...
 
virtual void send (const Block &wire)=0
 Send block of data from. More...
 
virtual void send (const Block &header, const Block &payload)=0
 Alternative version of sending data, applying scatter/gather I/O concept. More...
 
virtual void pause ()=0
 
virtual void resume ()=0
 
bool isConnected ()
 
bool isExpectingData ()
 

Protected Member Functions

void receive (const Block &wire)
 

Protected Attributes

boost::asio::io_service * m_ioService
 
bool m_isConnected
 
bool m_isExpectingData
 
ReceiveCallback m_receiveCallback
 

Detailed Description

Definition at line 32 of file transport.hpp.

Member Typedef Documentation

typedef function<void (const Block& wire)> ndn::Transport::ReceiveCallback

Definition at line 42 of file transport.hpp.

typedef function<void ()> ndn::Transport::ErrorCallback

Definition at line 43 of file transport.hpp.

Constructor & Destructor Documentation

ndn::Transport::Transport ( )
inline

Definition at line 107 of file transport.hpp.

ndn::Transport::~Transport ( )
inlinevirtual

Definition at line 127 of file transport.hpp.

Member Function Documentation

void ndn::Transport::connect ( boost::asio::io_service &  io_service,
const ReceiveCallback receiveCallback 
)
inlinevirtual

Connect transport.

Exceptions
boost::system::system_errorif connection cannot be established

Reimplemented in ndn::UnixTransport, and ndn::TcpTransport.

Definition at line 132 of file transport.hpp.

References m_ioService, and m_receiveCallback.

Referenced by ndn::TcpTransport::connect(), and ndn::UnixTransport::connect().

virtual void ndn::Transport::close ( )
pure virtual

Close the connection.

Implemented in ndn::UnixTransport, ndn::TcpTransport, and ndn::util::DummyClientFace::Transport.

virtual void ndn::Transport::send ( const Block wire)
pure virtual

Send block of data from.

Parameters
wirethrough the transport
wireA block of data to send

Implemented in ndn::UnixTransport, ndn::TcpTransport, and ndn::util::DummyClientFace::Transport.

virtual void ndn::Transport::send ( const Block header,
const Block payload 
)
pure virtual

Alternative version of sending data, applying scatter/gather I/O concept.

Two non-consecutive memory blocks will be send out together, e.g., as part of the same message in datagram-oriented transports.

Implemented in ndn::UnixTransport, ndn::util::DummyClientFace::Transport, and ndn::TcpTransport.

virtual void ndn::Transport::pause ( )
pure virtual
virtual void ndn::Transport::resume ( )
pure virtual
bool ndn::Transport::isConnected ( )
inline

Definition at line 140 of file transport.hpp.

References m_isConnected.

bool ndn::Transport::isExpectingData ( )
inline

Definition at line 146 of file transport.hpp.

References m_isExpectingData.

void ndn::Transport::receive ( const Block wire)
inlineprotected

Definition at line 152 of file transport.hpp.

References m_receiveCallback.

Member Data Documentation

boost::asio::io_service* ndn::Transport::m_ioService
protected

Definition at line 100 of file transport.hpp.

Referenced by connect(), and ndn::util::DummyClientFace::Transport::getIoService().

bool ndn::Transport::m_isConnected
protected

Definition at line 101 of file transport.hpp.

Referenced by isConnected().

bool ndn::Transport::m_isExpectingData
protected

Definition at line 102 of file transport.hpp.

Referenced by isExpectingData().

ReceiveCallback ndn::Transport::m_receiveCallback
protected

Definition at line 103 of file transport.hpp.

Referenced by connect(), ndn::util::DummyClientFace::Transport::receive(), and receive().


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