psync::SegmentPublisher Class Reference

Segment Publisher to publish segmented data. More...

#include <segment-publisher.hpp>

Public Member Functions

 SegmentPublisher (ndn::Face &face, ndn::KeyChain &keyChain, size_t imsLimit=MAX_SEGMENTS_STORED)
 
void publish (const ndn::Name &interestName, const ndn::Name &dataName, const ndn::Block &block, ndn::time::milliseconds freshness, const ndn::security::SigningInfo &signingInfo=ndn::security::v2::KeyChain::getDefaultSigningInfo())
 Put all the segments in memory. More...
 
bool replyFromStore (const ndn::Name &interestName)
 Try to reply from memory, return false if we cannot find the segment. More...
 

Detailed Description

Segment Publisher to publish segmented data.

Definition at line 40 of file segment-publisher.hpp.

Constructor & Destructor Documentation

psync::SegmentPublisher::SegmentPublisher ( ndn::Face &  face,
ndn::KeyChain &  keyChain,
size_t  imsLimit = MAX_SEGMENTS_STORED 
)

Definition at line 26 of file segment-publisher.cpp.

Member Function Documentation

void psync::SegmentPublisher::publish ( const ndn::Name &  interestName,
const ndn::Name &  dataName,
const ndn::Block &  block,
ndn::time::milliseconds  freshness,
const ndn::security::SigningInfo &  signingInfo = ndn::security::v2::KeyChain::getDefaultSigningInfo() 
)

Put all the segments in memory.

Parameters
interestNamethe interest name, to determine the sequence to be answered immediately
dataNamethe data name, has components after interest name
blockthe content of the data
freshnessfreshness of the segments
signingInfosigning info to sign the data with

Definition at line 36 of file segment-publisher.cpp.

bool psync::SegmentPublisher::replyFromStore ( const ndn::Name &  interestName)

Try to reply from memory, return false if we cannot find the segment.

The caller is then expected to use publish if this returns false.

Definition at line 96 of file segment-publisher.cpp.