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=100)
 
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::SigningInfo())
 Put all the segments in memory. More...
 
void publish (const ndn::Name &interestName, const ndn::Name &dataName, const ndn::ConstBufferPtr &buffer, ndn::time::milliseconds freshness, const ndn::security::SigningInfo &signingInfo=ndn::security::SigningInfo())
 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 37 of file segment-publisher.hpp.

Constructor & Destructor Documentation

◆ SegmentPublisher()

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

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

Member Function Documentation

◆ publish() [1/2]

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::SigningInfo() 
)

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 35 of file segment-publisher.cpp.

◆ publish() [2/2]

void psync::SegmentPublisher::publish ( const ndn::Name &  interestName,
const ndn::Name &  dataName,
const ndn::ConstBufferPtr &  buffer,
ndn::time::milliseconds  freshness,
const ndn::security::SigningInfo &  signingInfo = ndn::security::SigningInfo() 
)

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
bufferthe content of the data
freshnessfreshness of the segments
signingInfosigning info to sign the data with

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

◆ replyFromStore()

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 99 of file segment-publisher.cpp.