22 #ifndef NDN_UTIL_SEGMENT_FETCHER_HPP 23 #define NDN_UTIL_SEGMENT_FETCHER_HPP 25 #include "../common.hpp" 26 #include "../face.hpp" 27 #include "../security/v2/validator.hpp" 111 typedef function<void (uint32_t code, const std::string& msg)>
ErrorCallback;
142 shared_ptr<SegmentFetcher>
166 shared_ptr<SegmentFetcher>
169 shared_ptr<security::v2::Validator> validator,
175 shared_ptr<security::v2::Validator> validator,
180 fetchFirstSegment(
const Interest& baseInterest, shared_ptr<SegmentFetcher>
self);
183 fetchNextSegment(
const Interest& origInterest,
const Name& dataName, uint64_t segmentNo,
184 shared_ptr<SegmentFetcher>
self);
187 afterSegmentReceivedCb(
const Interest& origInterest,
188 const Data& data,
bool isSegmentZeroExpected,
189 shared_ptr<SegmentFetcher>
self);
191 afterValidationSuccess(
const Data& data,
192 bool isSegmentZeroExpected,
194 shared_ptr<SegmentFetcher>
self);
201 uint32_t reExpressCount, shared_ptr<SegmentFetcher>
self);
204 reExpressInterest(
Interest interest, uint32_t reExpressCount,
205 shared_ptr<SegmentFetcher>
self);
221 shared_ptr<security::v2::Validator> m_validator;
225 shared_ptr<OBufferStream> m_buffer;
231 #endif // NDN_UTIL_SEGMENT_FETCHER_HPP Copyright (c) 2011-2015 Regents of the University of California.
function< void(uint32_t code, const std::string &msg)> ErrorCallback
static shared_ptr< SegmentFetcher > fetch(Face &face, const Interest &baseInterest, security::v2::Validator &validator, const CompleteCallback &completeCallback, const ErrorCallback &errorCallback)
Initiates segment fetching.
Utility class to fetch latest version of the segmented data.
Represents an Interest packet.
provides a lightweight signal / event system
represents a Network Nack
ErrorCode
Error codes that can be passed to ErrorCallback.
Provide a communication channel with local or remote NDN forwarder.
Signal< SegmentFetcher, Data > afterSegmentValidated
Emits whenever a received data segment has been successfully validated.
Represents an absolute name.
Signal< SegmentFetcher, Data > afterSegmentReceived
Emits whenever a data segment received.
Validation error code and optional detailed error message.
static const uint32_t MAX_INTEREST_REEXPRESS
Maximum number of times an interest will be reexpressed incase of NackCallback.
Represents a Data packet.
Interface for validating data and interest packets.
function< void(const ConstBufferPtr &data)> CompleteCallback