本文整理汇总了C++中ndn::Name::append方法的典型用法代码示例。如果您正苦于以下问题:C++ Name::append方法的具体用法?C++ Name::append怎么用?C++ Name::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ndn::Name
的用法示例。
在下文中一共展示了Name::append方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
NdnRtcNamespace::appendStringComponent(ndn::Name &prefix,
const std::string &stringComponent)
{
prefix.append((const unsigned char*)stringComponent.c_str(),
stringComponent.size());
}
示例2: publishManifest
void VideoStreamImpl::publishManifest(ndn::Name dataName, PublishedDataPtrVector &segments)
{
Manifest m(segments);
dataName.append(NameComponents::NameComponentManifest).appendVersion(0);
PublishedDataPtrVector ss = metadataPublisher_->publish(dataName, m);
LogDebugC << (busyPublishing_ == 1 ? "⤷" : "↓")
<< " published manifest ☆ (" << dataName.getSubName(-5, 5) << ")x"
<< ss.size() << std::endl;
}
示例3: interestName
void
HelloProtocol::processInterest(const ndn::Name& name,
const ndn::Interest& interest)
{
/* interest name: /<neighbor>/NLSR/INFO/<router> */
const ndn::Name interestName = interest.getName();
_LOG_DEBUG("Interest Received for Name: " << interestName);
if (interestName.get(-2).toUri() != INFO_COMPONENT) {
return;
}
ndn::Name neighbor;
neighbor.wireDecode(interestName.get(-1).blockFromValue());
_LOG_DEBUG("Neighbor: " << neighbor);
if (m_nlsr.getAdjacencyList().isNeighbor(neighbor)) {
ndn::shared_ptr<ndn::Data> data = ndn::make_shared<ndn::Data>();
data->setName(ndn::Name(interest.getName()).appendVersion());
data->setFreshnessPeriod(ndn::time::seconds(10)); // 10 sec
data->setContent(reinterpret_cast<const uint8_t*>(INFO_COMPONENT.c_str()),
INFO_COMPONENT.size());
m_nlsr.getKeyChain().sign(*data, m_nlsr.getDefaultCertName());
_LOG_DEBUG("Sending out data for name: " << interest.getName());
m_nlsr.getNlsrFace().put(*data);
Adjacent *adjacent = m_nlsr.getAdjacencyList().findAdjacent(neighbor);
if (adjacent->getStatus() == 0) {
if(adjacent->getFaceId() != 0){
/* interest name: /<neighbor>/NLSR/INFO/<router> */
ndn::Name interestName(neighbor);
interestName.append(NLSR_COMPONENT);
interestName.append(INFO_COMPONENT);
interestName.append(m_nlsr.getConfParameter().getRouterPrefix().wireEncode());
expressInterest(interestName,
m_nlsr.getConfParameter().getInterestResendTime());
}
else {
registerPrefixes(adjacent->getName(), adjacent->getConnectingFaceUri(),
adjacent->getLinkCost(), ndn::time::milliseconds::max());
}
}
}
}