esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | List of all members
ndnph::BasicSegmentConsumer< SegmentConvention, regionCap > Class Template Reference

Consumer of segmented object, using a stop-and-wait algorithm. More...

#include <segment-consumer.hpp>

Inherits ndnph::SegmentConsumerBase.

Public Member Functions

 SegmentConsumerBase (Face &face, Options opts)
 Constructor.
 
 SegmentConsumerBase (Face &face)
 
- Public Member Functions inherited from ndnph::SegmentConsumerBase
 SegmentConsumerBase (Face &face, Options opts)
 Constructor.
 
 SegmentConsumerBase (Face &face)
 
void setSegmentCallback (SegmentCallback cb, void *ctx)
 Assign SegmentCallback.
 
void saveTo (SaveDest &dest)
 Save content to destination.
 
void start (Name prefix)
 Start fetching content under given prefix.
 
void stop ()
 Stop fetching.
 
bool isRunning () const
 Determine whether fetching is in progress (not completed or failed).
 
- Public Member Functions inherited from ndnph::PacketHandler
 PacketHandler ()=default
 Construct without adding to Face.
 
 PacketHandler (Face &face, int8_t prio=0)
 Construct and add handler to Face.
 

Private Member Functions

void loop () final
 Override to be invoked periodically.
 
bool processData (Data data) final
 Override to receive Data packets.
 

Additional Inherited Members

- Public Types inherited from ndnph::SegmentConsumerBase
using SegmentCallback = void(*)(void *ctx, uint64_t segment, Data data)
 Callback upon segment arrival.
 
- Public Types inherited from ndnph::PacketHandler
using PacketInfo = Face::PacketInfo
 
- Protected Member Functions inherited from ndnph::SegmentConsumerBase
void invokeCallback (Data data)
 
- Protected Member Functions inherited from ndnph::PacketHandler
virtual ~PacketHandler ()
 Remove handler from Face.
 
FacegetFace () const
 
const PacketInfogetCurrentPacketInfo () const
 Retrieve information about current processing packet.
 
template<typename Packet >
bool send (Region &region, const Packet &packet, PacketInfo pi={})
 Synchronously transmit a packet.
 
template<typename Packet , typename... PacketInfoModifier>
bool send (Region &region, const Packet &packet, const PacketInfoModifier &... pim)
 Synchronously transmit a packet.
 
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.
 
template<typename... Arg>
bool reply (Arg &&... arg)
 Synchronously transmit a packet in reply to current processing packet.
 
- Protected Attributes inherited from ndnph::SegmentConsumerBase
Options m_opts
 
SegmentCallback m_cb = nullptr
 
void * m_cbCtx = nullptr
 
Name m_prefix
 
uint64_t m_segment = 0
 
OutgoingPendingInterest m_pending
 
int m_retxRemain = 0
 
bool m_running = false
 

Detailed Description

template<typename SegmentConvention = convention::Segment, size_t regionCap = 1024>
class ndnph::BasicSegmentConsumer< SegmentConvention, regionCap >

Consumer of segmented object, using a stop-and-wait algorithm.

Template Parameters
SegmentConventionsegment component convention.
regionCapencoding region capacity.

Member Function Documentation

◆ loop()

template<typename SegmentConvention = convention::Segment, size_t regionCap = 1024>
void ndnph::BasicSegmentConsumer< SegmentConvention, regionCap >::loop ( )
inlinefinalprivatevirtual

Override to be invoked periodically.

Reimplemented from ndnph::PacketHandler.

◆ processData()

template<typename SegmentConvention = convention::Segment, size_t regionCap = 1024>
bool ndnph::BasicSegmentConsumer< SegmentConvention, regionCap >::processData ( Data  )
inlinefinalprivatevirtual

Override to receive Data packets.

Return values
truepacket has been accepted by this handler.
falsepacket is not accepted, and should go to the next handler.

Reimplemented from ndnph::PacketHandler.

◆ SegmentConsumerBase() [1/2]

template<typename SegmentConvention = convention::Segment, size_t regionCap = 1024>
ndnph::SegmentConsumerBase::SegmentConsumerBase ( Face face)
inlineexplicit

◆ SegmentConsumerBase() [2/2]

template<typename SegmentConvention = convention::Segment, size_t regionCap = 1024>
ndnph::SegmentConsumerBase::SegmentConsumerBase ( Face face,
Options  opts 
)
inlineexplicit

Constructor.

Parameters
faceface for communication.
optsoptions.

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