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 wire through the transport. 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 39 of file transport.hpp.

Member Typedef Documentation

§ ReceiveCallback

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

Definition at line 49 of file transport.hpp.

§ ErrorCallback

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

Definition at line 50 of file transport.hpp.

Constructor & Destructor Documentation

§ Transport()

ndn::Transport::Transport ( )
inline

Definition at line 114 of file transport.hpp.

§ ~Transport()

ndn::Transport::~Transport ( )
inlinevirtual

Definition at line 134 of file transport.hpp.

Member Function Documentation

§ connect()

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 139 of file transport.hpp.

References m_ioService, and m_receiveCallback.

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

§ close()

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

§ send() [1/2]

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

Send block of data from wire through the transport.

Parameters
wireA block of data to send

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

§ send() [2/2]

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 nfd::face::InternalClientTransport, ndn::UnixTransport, ndn::util::DummyClientFace::Transport, and ndn::TcpTransport.

§ pause()

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

§ resume()

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

§ isConnected()

bool ndn::Transport::isConnected ( )
inline

Definition at line 147 of file transport.hpp.

References m_isConnected.

§ isExpectingData()

bool ndn::Transport::isExpectingData ( )
inline

Definition at line 153 of file transport.hpp.

References m_isExpectingData.

§ receive()

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

Definition at line 159 of file transport.hpp.

References m_receiveCallback.

Member Data Documentation

§ m_ioService

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

Definition at line 107 of file transport.hpp.

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

§ m_isConnected

bool ndn::Transport::m_isConnected
protected

Definition at line 108 of file transport.hpp.

Referenced by isConnected().

§ m_isExpectingData

bool ndn::Transport::m_isExpectingData
protected

Definition at line 109 of file transport.hpp.

Referenced by isExpectingData().

§ m_receiveCallback

ReceiveCallback ndn::Transport::m_receiveCallback
protected

Definition at line 110 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: