22 #ifndef NDN_CXX_TRANSPORT_TRANSPORT_HPP
23 #define NDN_CXX_TRANSPORT_TRANSPORT_HPP
29 #include <boost/system/error_code.hpp>
39 class Error :
public std::runtime_error
42 using std::runtime_error::runtime_error;
44 Error(
const boost::system::error_code& code,
const std::string& msg);
Represents a TLV element of the NDN packet format.
Error(const boost::system::error_code &code, const std::string &msg)
Provides a "TLV-oriented" delivery service.
boost::asio::io_service * m_ioService
std::function< void(const Block &)> ReceiveCallback
virtual void resume()=0
Resume the transport.
virtual void send(const Block &block)=0
Send a TLV block through the transport.
State getState() const noexcept
Return the current state of the transport.
virtual void connect(boost::asio::io_service &ioService, ReceiveCallback receiveCallback)
Asynchronously open the connection.
virtual ~Transport()=default
void setState(State state) noexcept
ReceiveCallback m_receiveCallback
virtual void close()=0
Close the connection.
virtual void pause()=0
Pause the transport, canceling all pending operations.
Common includes and macros used throughout the library.