| /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| * Copyright (C) 2013 Regents of the University of California. |
| * @author: Jeff Thompson <jefft0@remap.ucla.edu> |
| * See COPYING for copyright and distribution information. |
| #ifndef NDN_TRANSPORT_HPP |
| #define NDN_TRANSPORT_HPP |
| #include <ndn-cpp/common.hpp> |
| #include <boost/asio.hpp> |
| typedef ptr_lib::function<void (const Block &wire)> ReceiveCallback; |
| * Connect according to the info in ConnectionInfo, and processEvents() will use elementListener. |
| * @param connectionInfo A reference to an object of a subclass of ConnectionInfo. |
| connect(boost::asio::io_service &io_service, const ReceiveCallback &receiveCallback); |
| * @param data A pointer to the buffer of data to send. |
| * @param dataLength The number of bytes in data. |
| send(const Block &wire) = 0; |
| receive(const Block &wire); |
| boost::asio::io_service *ioService_; |
| ReceiveCallback receiveCallback_; |
| Transport::connect(boost::asio::io_service &ioService, const ReceiveCallback &receiveCallback) |
| receiveCallback_ = receiveCallback; |
| Transport::receive(const Block &wire) |