psync::SegmentPublisher Class Reference

Helper class to publish segmented data. More...

#include <PSync/segment-publisher.hpp>

Public Member Functions

 SegmentPublisher (ndn::Face &face, ndn::KeyChain &keyChain, const ndn::security::SigningInfo &signingInfo=ndn::security::SigningInfo(), size_t imsLimit=100)
 
void publish (const ndn::Name &interestName, const ndn::Name &dataName, ndn::span< const uint8_t > buffer, ndn::time::milliseconds freshness)
 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

Helper class to publish segmented data.

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

Constructor & Destructor Documentation

◆ SegmentPublisher()

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

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

Member Function Documentation

◆ publish()

void psync::SegmentPublisher::publish ( const ndn::Name &  interestName,
const ndn::Name &  dataName,
ndn::span< const uint8_t >  buffer,
ndn::time::milliseconds  freshness 
)

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 period of the segments

Definition at line 34 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 56 of file segment-publisher.cpp.