本文整理汇总了C++中Name::appendSequenceNumber方法的典型用法代码示例。如果您正苦于以下问题:C++ Name::appendSequenceNumber方法的具体用法?C++ Name::appendSequenceNumber怎么用?C++ Name::appendSequenceNumber使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Name
的用法示例。
在下文中一共展示了Name::appendSequenceNumber方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sample
void
Pipeliner::fillUpPipeline(const ndn::Name& threadPrefix)
{
if (interestControl_->room() > 0)
LogDebugC << interestControl_->room()
<< " sample(s) will be requested"
<< std::endl;
while (interestControl_->room() > 0)
{
Name n = nameScheme_->samplePrefix(threadPrefix, nextSamplePriority_);
n.appendSequenceNumber((nextSamplePriority_ == SampleClass::Delta ?
seqCounter_.delta_ : seqCounter_.key_));
const std::vector<boost::shared_ptr<const Interest>> batch = getBatch(n, nextSamplePriority_);
int64_t deadline = playbackQueue_->size()+playbackQueue_->pendingSize();
request(batch, DeadlinePriority::fromNow(deadline));
buffer_->requested(batch);
interestControl_->increment();
LogDebugC << "requested "
<< (nextSamplePriority_ == SampleClass::Delta ? seqCounter_.delta_ : seqCounter_.key_)
<< " " << SAMPLE_SUFFIX(n) << " x" << batch.size() << std::endl;
if (nextSamplePriority_ == SampleClass::Delta) seqCounter_.delta_++;
else seqCounter_.key_++;
(*sstorage_)[Indicator::RequestedNum]++;
if (nextSamplePriority_ == SampleClass::Key)
(*sstorage_)[Indicator::RequestedKeyNum]++;
nextSamplePriority_ = SampleClass::Delta;
}
}
示例2: postNotification
void
postNotification(const Notification& notification)
{
Name dataName = m_prefix;
dataName.appendSequenceNumber(m_sequenceNo);
shared_ptr<Data> data = make_shared<Data>(dataName);
data->setContent(notification.wireEncode());
data->setFreshnessPeriod(time::seconds(1));
m_keyChain.sign(*data);
m_face.put(*data);
++m_sequenceNo;
}
示例3: getBatch
void
Pipeliner::express(const ndn::Name& threadPrefix, bool placeInBuffer)
{
Name n = nameScheme_->samplePrefix(threadPrefix, nextSamplePriority_);
n.appendSequenceNumber((nextSamplePriority_ == SampleClass::Delta ? seqCounter_.delta_ : seqCounter_.key_));
const std::vector<boost::shared_ptr<const Interest>> batch = getBatch(n, nextSamplePriority_);
LogDebugC << "sample "
<< (nextSamplePriority_ == SampleClass::Delta ? seqCounter_.delta_ : seqCounter_.key_)
<< " " << SAMPLE_SUFFIX(n) << " batch size " << batch.size() << std::endl;
request(batch, DeadlinePriority::fromNow(0));
if (placeInBuffer) buffer_->requested(batch);
nextSamplePriority_ = SampleClass::Delta;
}
示例4:
Name
NamespaceInfo::getSuffix(int filter) const
{
using namespace suffix_filter;
Name suffix;
if (filter)
{
if (filter&(Library^Stream))
suffix.append(Name(NameComponents::NameComponentApp)).appendVersion(apiVersion_);
if (filter&(Stream^Thread))
{
suffix.append((streamType_ == MediaStreamParams::MediaStreamType::MediaStreamTypeAudio ?
NameComponents::NameComponentAudio : NameComponents::NameComponentVideo)).append(streamName_);
if (threadName_ != "")
suffix.appendTimestamp(streamTimestamp_);
}
if (filter&(Thread^Sample) && threadName_ != "")
suffix.append(threadName_);
if (isMeta_)
{
if ((filter&(Thread^Sample) && threadName_ != "") ||
filter&(Stream^Thread))
suffix.append(NameComponents::NameComponentMeta);
}
if (filter&(Thread^Sample) && threadName_ != "" &&
streamType_ == MediaStreamParams::MediaStreamType::MediaStreamTypeVideo &&
!isMeta_)
suffix.append((class_ == SampleClass::Delta ? NameComponents::NameComponentDelta : NameComponents::NameComponentKey));
if (filter&(Sample^Segment))
{
if (isMeta_)
suffix.appendVersion(metaVersion_);
else
suffix.appendSequenceNumber(sampleNo_);
}
if (filter&(Segment) && hasSegNo_)
{
if (isParity_)
suffix.append(NameComponents::NameComponentParity);
suffix.appendSegment(segNo_);
}
}
return suffix;
}
示例5: sendNextInterest
void
sendNextInterest()
{
if (this->shouldStop())
return;
BOOST_ASSERT(m_lastSequenceNo !=
std::numeric_limits<uint64_t>::max());// overflow or missing initial reply
Name nextName = m_prefix;
nextName.appendSequenceNumber(m_lastSequenceNo + 1);
shared_ptr<Interest> interest = make_shared<Interest>(nextName);
interest->setInterestLifetime(getInterestLifetime());
m_lastInterestId = m_face.expressInterest(*interest,
bind(&NotificationSubscriber<Notification>::afterReceiveData, this, _2),
bind(&NotificationSubscriber<Notification>::afterReceiveNack, this, _2),
bind(&NotificationSubscriber<Notification>::afterTimeout, this));
}