#include <segment-consumer.hpp>
Inherits ndnph::PacketHandler.
Inherited by ndnph::BasicSegmentConsumer< SegmentConvention, regionCap >.
|
void | invokeCallback (Data data) |
|
Protected Member Functions inherited from ndnph::PacketHandler |
virtual | ~PacketHandler () |
| Remove handler from Face. More...
|
|
Face * | getFace () const |
|
const PacketInfo * | getCurrentPacketInfo () const |
| Retrieve information about current processing packet. More...
|
|
template<typename Packet > |
bool | send (Region ®ion, const Packet &packet, PacketInfo pi={}) |
| Synchronously transmit a packet. More...
|
|
template<typename Packet , typename... PacketInfoModifier> |
bool | send (Region ®ion, const Packet &packet, const PacketInfoModifier &... pim) |
| Synchronously transmit a packet. More...
|
|
template<typename Packet , typename... Arg, typename = typename std::enable_if< !std::is_base_of<Region, typename std::decay<Packet>::type>::value>::type> |
bool | send (const Packet &packet, Arg &&... arg) |
| Synchronously transmit a packet. More...
|
|
template<typename... Arg> |
bool | reply (Arg &&... arg) |
| Synchronously transmit a packet in reply to current processing packet. More...
|
|
◆ SegmentCallback
Callback upon segment arrival.
- Parameters
-
ctx | user specified context. |
segment | segment number; they will appear sequentially. |
data | the Data packet. |
If a segment retrieval has failed, the callback will be invoked with invalid Data where !data
evaluates to true, and no more callbacks will be invoked. If fetching has completed successfully, the callback will be invoked with the last Data where data.getIsFinalBlock()
evaluates to true, and no more callbacks will be invoked.
◆ SegmentConsumerBase() [1/2]
ndnph::SegmentConsumerBase::SegmentConsumerBase |
( |
Face & |
face, |
|
|
Options |
opts |
|
) |
| |
|
inlineexplicit |
Constructor.
- Parameters
-
face | face for communication. |
opts | options. |
◆ SegmentConsumerBase() [2/2]
ndnph::SegmentConsumerBase::SegmentConsumerBase |
( |
Face & |
face | ) |
|
|
inlineexplicit |
◆ invokeCallback()
void ndnph::SegmentConsumerBase::invokeCallback |
( |
Data |
data | ) |
|
|
inlineprotected |
◆ isRunning()
bool ndnph::SegmentConsumerBase::isRunning |
( |
| ) |
const |
|
inline |
Determine whether fetching is in progress (not completed or failed).
◆ saveTo()
void ndnph::SegmentConsumerBase::saveTo |
( |
SaveDest & |
dest | ) |
|
|
inline |
Save content to destination.
- Parameters
-
dest | saving destination, must be kept alive while SegmentConsumer is running. |
This should be invoked before start()
. This cannot be used together with SegmentCallback.
◆ setSegmentCallback()
void ndnph::SegmentConsumerBase::setSegmentCallback |
( |
SegmentCallback |
cb, |
|
|
void * |
ctx |
|
) |
| |
|
inline |
Assign SegmentCallback.
This should be invoked before start()
.
◆ start()
void ndnph::SegmentConsumerBase::start |
( |
Name |
prefix | ) |
|
|
inline |
Start fetching content under given prefix.
If another fetching is in progress, it will be aborted. The callback will not be invoked.
◆ stop()
void ndnph::SegmentConsumerBase::stop |
( |
| ) |
|
|
inline |
Stop fetching.
The callback will not be invoked.
◆ m_cb
◆ m_cbCtx
void* ndnph::SegmentConsumerBase::m_cbCtx = nullptr |
|
protected |
◆ m_opts
Options ndnph::SegmentConsumerBase::m_opts |
|
protected |
◆ m_pending
◆ m_prefix
Name ndnph::SegmentConsumerBase::m_prefix |
|
protected |
◆ m_retxRemain
int ndnph::SegmentConsumerBase::m_retxRemain = 0 |
|
protected |
◆ m_running
bool ndnph::SegmentConsumerBase::m_running = false |
|
protected |
◆ m_segment
uint64_t ndnph::SegmentConsumerBase::m_segment = 0 |
|
protected |
The documentation for this class was generated from the following file: