22 #ifndef NDN_UTIL_SEGMENT_FETCHER_HPP 23 #define NDN_UTIL_SEGMENT_FETCHER_HPP 25 #include "../common.hpp" 26 #include "../face.hpp" 117 typedef function<void (uint32_t code, const std::string& msg)>
ErrorCallback;
123 INTEREST_TIMEOUT = 1,
124 DATA_HAS_NO_SEGMENT = 2,
125 SEGMENT_VERIFICATION_FAIL = 3
148 const VerifySegment& verifySegment,
149 const CompleteCallback& completeCallback,
150 const ErrorCallback& errorCallback);
154 const VerifySegment& verifySegment,
155 const CompleteCallback& completeCallback,
156 const ErrorCallback& errorCallback);
159 fetchFirstSegment(
const Interest& baseInterest,
const shared_ptr<SegmentFetcher>&
self);
162 fetchNextSegment(
const Interest& origInterest,
const Name& dataName, uint64_t segmentNo,
163 const shared_ptr<SegmentFetcher>&
self);
166 onSegmentReceived(
const Interest& origInterest,
167 const Data& data,
bool isSegmentZeroExpected,
168 const shared_ptr<SegmentFetcher>&
self);
172 VerifySegment m_verifySegment;
173 CompleteCallback m_completeCallback;
174 ErrorCallback m_errorCallback;
176 shared_ptr<OBufferStream> m_buffer;
182 #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
Utility class to fetch latest version of the segmented data.
function< bool(const Data &data)> VerifySegment
represents an Interest packet
bool operator()(const Data &data) const
Functor to skip validation of individual packets by SegmentFetcher.
ErrorCode
Error codes that can be passed to ErrorCallback.
Abstraction to communicate with local or remote NDN forwarder.
Name abstraction to represent an absolute name.
function< void(const ConstBufferPtr &data)> CompleteCallback