Represents an absolute name. More...
#include <name.hpp>
Classes | |
class | Error |
Public Types | |
using | Component = name::Component |
using | component_container = std::vector< Component > |
using | value_type = Component |
using | allocator_type = void |
using | reference = Component & |
using | const_reference = const Component & |
using | pointer = Component * |
using | const_pointer = const Component * |
using | iterator = const Component * |
using | const_iterator = const Component * |
using | reverse_iterator = std::reverse_iterator< iterator > |
using | const_reverse_iterator = std::reverse_iterator< const_iterator > |
using | difference_type = component_container::difference_type |
using | size_type = component_container::size_type |
Public Member Functions | |
Name () | |
Create an empty name. More... | |
Name (const Block &wire) | |
Decode Name from wire encoding. More... | |
Name (const char *uri) | |
Parse name from NDN URI. More... | |
Name (std::string uri) | |
Create name from NDN URI. More... | |
std::string | toUri () const |
Get URI representation of the name. More... | |
bool | hasWire () const |
Check if this Name instance already has wire encoding. More... | |
template<encoding::Tag TAG> | |
size_t | wireEncode (EncodingImpl< TAG > &encoder) const |
Fast encoding or block size estimation. More... | |
const Block & | wireEncode () const |
Perform wire encoding, or return existing wire encoding. More... | |
void | wireDecode (const Block &wire) |
Decode name from wire encoding. More... | |
Name | deepCopy () const |
Make a deep copy of the name, reallocating the underlying memory buffer. More... | |
bool | empty () const |
Check if name is empty. More... | |
size_t | size () const |
Get number of components. More... | |
const Component & | get (ssize_t i) const |
Get the component at the given index. More... | |
const Component & | operator[] (ssize_t i) const |
Equivalent to get(i) More... | |
const Component & | at (ssize_t i) const |
Get the component at the given index. More... | |
PartialName | getSubName (ssize_t iStartComponent, size_t nComponents=npos) const |
Extract some components as a sub-name (PartialName) More... | |
PartialName | getPrefix (ssize_t nComponents) const |
Extract a prefix of the name. More... | |
const_iterator | begin () const |
Begin iterator. More... | |
const_iterator | end () const |
End iterator. More... | |
const_reverse_iterator | rbegin () const |
Reverse begin iterator. More... | |
const_reverse_iterator | rend () const |
Reverse end iterator. More... | |
Name & | append (const Component &component) |
Append a component. More... | |
Name & | append (const char *value) |
Append a component, copying from a zero-terminated byte string. More... | |
Name & | append (const uint8_t *value, size_t valueLength) |
Append a component, copying from [value , value + valueLength ) More... | |
template<class Iterator > | |
Name & | append (Iterator first, Iterator last) |
Append a component, copying from [first , last ) More... | |
Name & | append (const Block &value) |
Append a component, decoding from a Block. More... | |
Name & | appendNumber (uint64_t number) |
Append a component with a nonNegativeInteger. More... | |
Name & | appendNumberWithMarker (uint8_t marker, uint64_t number) |
Append a component with a marked number. More... | |
Name & | appendVersion (uint64_t version) |
Append a version component. More... | |
Name & | appendVersion () |
Append a version component based on current time. More... | |
Name & | appendSegment (uint64_t segmentNo) |
Append a segment number (sequential) component. More... | |
Name & | appendSegmentOffset (uint64_t offset) |
Append a segment byte offset component. More... | |
Name & | appendTimestamp (const time::system_clock::TimePoint &timePoint) |
Append a timestamp component. More... | |
Name & | appendTimestamp () |
Append a timestamp component based on current time. More... | |
Name & | appendSequenceNumber (uint64_t seqNo) |
Append a sequence number component. More... | |
Name & | appendImplicitSha256Digest (const ConstBufferPtr &digest) |
Append an ImplicitSha256Digest component. More... | |
Name & | appendImplicitSha256Digest (const uint8_t *digest, size_t digestSize) |
Append an ImplicitSha256Digest component. More... | |
Name & | append (const PartialName &name) |
Append a PartialName. More... | |
template<class T > | |
void | push_back (const T &component) |
Append a component. More... | |
void | clear () |
Remove all components. More... | |
Name | getSuccessor () const |
Get the successor of a name. More... | |
bool | isPrefixOf (const Name &other) const |
Check if this name is a prefix of another name. More... | |
bool | equals (const Name &other) const |
Check if this name equals another name. More... | |
int | compare (const Name &other) const |
Compare this to the other Name using NDN canonical ordering. More... | |
int | compare (size_t pos1, size_t count1, const Name &other, size_t pos2=0, size_t count2=npos) const |
compares [pos1, pos1+count1) components in this Name to [pos2, pos2+count2) components in other More... | |
Static Public Attributes | |
static const size_t | npos = std::numeric_limits<size_t>::max() |
indicates "until the end" in getSubName and compare More... | |
using ndn::Name::Component = name::Component |
using ndn::Name::component_container = std::vector<Component> |
using ndn::Name::value_type = Component |
using ndn::Name::allocator_type = void |
using ndn::Name::reference = Component& |
using ndn::Name::const_reference = const Component& |
using ndn::Name::pointer = Component* |
using ndn::Name::const_pointer = const Component* |
using ndn::Name::iterator = const Component* |
using ndn::Name::const_iterator = const Component* |
using ndn::Name::reverse_iterator = std::reverse_iterator<iterator> |
using ndn::Name::const_reverse_iterator = std::reverse_iterator<const_iterator> |
using ndn::Name::difference_type = component_container::difference_type |
using ndn::Name::size_type = component_container::size_type |
ndn::Name::Name | ( | ) |
Create an empty name.
Definition at line 56 of file name.cpp.
Referenced by ndn::operator>>().
|
explicit |
Decode Name from wire encoding.
tlv::Error | wire encoding is invalid |
This is a more efficient equivalent for
Definition at line 61 of file name.cpp.
References ndn::Block::parse().
ndn::Name::Name | ( | const char * | uri | ) |
Parse name from NDN URI.
uri | a null-terminated URI string |
ndn::Name::Name | ( | std::string | uri | ) |
Create name from NDN URI.
uri | a URI string |
Definition at line 72 of file name.cpp.
References append(), and ndn::name::Component::fromEscapedString().
std::string ndn::Name::toUri | ( | ) | const |
Get URI representation of the name.
os << name
. Definition at line 122 of file name.cpp.
Referenced by ndn::security::pib::CertificateContainer::add(), ndn::security::pib::KeyContainer::add(), ndn::security::v2::KeyChain::addCertificate(), ndn::security::v2::ValidationPolicySimpleHierarchy::checkPolicy(), ndn::security::v2::validator_config::ValidationPolicyConfig::checkPolicy(), ndn::security::v2::ValidationPolicyCommandInterest::checkPolicy(), ndn::security::tpm::BackEnd::createKey(), ndn::security::v2::KeyChain::deleteCertificate(), ndn::security::v2::KeyChain::deleteKey(), ndn::security::tpm::BackEndOsx::derivePublicKey(), ndn::security::v2::CertificateFetcherFromNetwork::doFetch(), nfd::TablesConfigSection::ensureConfigured(), ndn::security::tpm::BackEnd::exportKey(), ndn::security::v2::KeyChain::exportSafeBag(), ndn::security::v2::extractIdentityFromCertName(), ndn::security::v2::extractIdentityFromKeyName(), ndn::security::v2::extractKeyNameFromCertName(), ndn::security::pib::CertificateContainer::get(), ndn::security::pib::KeyContainer::get(), ndn::security::pib::PibMemory::getCertificate(), ndn::security::pib::PibSqlite3::getCertificate(), ndn::security::pib::PibMemory::getDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::getDefaultCertificateOfKey(), ndn::security::pib::PibMemory::getDefaultKeyOfIdentity(), ndn::security::pib::PibSqlite3::getDefaultKeyOfIdentity(), ndn::security::tpm::BackEndOsx::Impl::getKey(), ndn::security::pib::PibMemory::getKeyBits(), ndn::security::pib::PibSqlite3::getKeyBits(), ndn::security::pib::detail::IdentityImpl::IdentityImpl(), ndn::security::tpm::BackEnd::importKey(), ndn::security::v2::KeyChain::importSafeBag(), nfd::rib::RibManager::onRibUpdateFailure(), ndn::security::v2::parseLocatorUri(), ndn::security::pib::CertificateContainer::remove(), ndn::security::pib::KeyContainer::remove(), ndn::security::pib::PibMemory::setDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::setDefaultCertificateOfKey(), ndn::security::pib::PibMemory::setDefaultKeyOfIdentity(), ndn::security::pib::PibSqlite3::setDefaultKeyOfIdentity(), ndn::security::v2::Validator::validate(), ndn::security::v2::DataValidationState::~DataValidationState(), and ndn::security::v2::InterestValidationState::~InterestValidationState().
|
inline |
Check if this Name instance already has wire encoding.
Definition at line 113 of file name.hpp.
References deepCopy(), wireDecode(), and wireEncode().
size_t ndn::Name::wireEncode | ( | EncodingImpl< TAG > & | encoder | ) | const |
Fast encoding or block size estimation.
Definition at line 131 of file name.cpp.
References ndn::tlv::Name, and ndn::NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS().
Referenced by nfd::DeadNonceList::add(), ndn::security::pib::PibSqlite3::addCertificate(), ndn::security::pib::PibSqlite3::addIdentity(), ndn::security::pib::PibSqlite3::addKey(), nfd::name_tree::computeHash(), nfd::name_tree::computeHashes(), deepCopy(), ndn::security::pib::PibSqlite3::getCertificate(), ndn::security::pib::PibSqlite3::getCertificatesOfKey(), ndn::security::pib::PibSqlite3::getDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::getDefaultKeyOfIdentity(), ndn::security::pib::PibSqlite3::getKeyBits(), ndn::security::pib::PibSqlite3::getKeysOfIdentity(), ndn::security::pib::PibSqlite3::hasCertificate(), ndn::security::pib::PibSqlite3::hasIdentity(), ndn::security::pib::PibSqlite3::hasKey(), std::hash< ndn::Name >::operator()(), ndn::security::parse(), ndn::security::pib::PibSqlite3::removeCertificate(), ndn::security::pib::PibSqlite3::removeIdentity(), ndn::security::pib::PibSqlite3::removeKey(), ndn::security::pib::PibSqlite3::setDefaultCertificateOfKey(), ndn::security::pib::PibSqlite3::setDefaultIdentity(), ndn::security::pib::PibSqlite3::setDefaultKeyOfIdentity(), ndn::security::v2::KeyChain::sign(), ndn::security::tpm::BackEndFile::Impl::toFileName(), ndn::nfd::StrategyChoice::wireEncode(), ndn::Data::wireEncode(), ndn::Interest::wireEncode(), ndn::KeyLocator::wireEncode(), and ndn::nfd::ControlParameters::wireEncode().
const Block & ndn::Name::wireEncode | ( | ) | const |
Perform wire encoding, or return existing wire encoding.
Definition at line 146 of file name.cpp.
References ndn::Block::hasWire(), and ndn::Block::parse().
Referenced by hasWire().
void ndn::Name::wireDecode | ( | const Block & | wire | ) |
Decode name from wire encoding.
tlv::Error | wire encoding is invalid |
Definition at line 164 of file name.cpp.
References ndn::tlv::Name, ndn::Block::parse(), and ndn::Block::type().
Referenced by hasWire(), ndn::nfd::StrategyChoice::wireDecode(), ndn::DelegationList::wireDecode(), ndn::Interest::wireDecode(), ndn::KeyLocator::wireDecode(), ndn::nfd::ControlParameters::wireDecode(), and ndn::Data::wireDecode().
Name ndn::Name::deepCopy | ( | ) | const |
Make a deep copy of the name, reallocating the underlying memory buffer.
Definition at line 174 of file name.cpp.
References ndn::Block::resetWire(), and wireEncode().
Referenced by hasWire().
|
inline |
Check if name is empty.
Definition at line 146 of file name.hpp.
Referenced by nfd::fw::AccessStrategy::beforeSatisfyInterest(), nfd::cs::compareQueryWithData(), nfd::rib::AutoPrefixPropagator::disable(), ndn::security::v2::CertificateBundleFetcher::doFetch(), ndn::util::SegmentFetcher::fetch(), ndn::Data::getFullName(), nfd::measurements::Measurements::getParent(), getSuccessor(), nfd::name_tree::NameTree::lookup(), ndn::operator<<(), and ndn::InMemoryStorage::selectChild().
|
inline |
Get number of components.
Definition at line 154 of file name.hpp.
Referenced by ndn::mgmt::Dispatcher::addStatusDataset(), append(), at(), ndn::security::v2::validator_config::Checker::check(), ndn::security::v2::validator_config::checkNameRelation(), ndn::security::v2::ValidationPolicyCommandInterest::checkPolicy(), compare(), nfd::cs::compareQueryWithData(), nfd::name_tree::computeHash(), nfd::name_tree::computeHashes(), nfd::rib::AutoPrefixPropagator::disable(), ndn::InterestFilter::doesMatch(), ndn::security::v2::CertificateBundleFetcher::doFetch(), equals(), nfd::strategy_choice::StrategyChoice::erase(), ndn::RegexTopMatcher::expand(), ndn::security::v2::CertificateCache::find(), nfd::cs::Cs::find(), nfd::name_tree::NameTree::findExactMatch(), nfd::name_tree::NameTree::findLongestPrefixMatch(), nfd::rib::Rib::findParent(), get(), ndn::security::v2::getKeyLocatorName(), nfd::fw::asf::AsfMeasurements::getOrCreateNamespaceInfo(), getPrefix(), getSubName(), nfd::strategy_choice::StrategyChoice::insert(), isPrefixOf(), ndn::security::v2::isValidKeyName(), ndn::security::v2::Certificate::isValidName(), nfd::name_tree::NameTree::lookup(), nfd::CommandAuthenticator::makeAuthorization(), ndn::RegexTopMatcher::match(), ndn::security::v2::validator_config::Filter::match(), ndn::Interest::matchesData(), ndn::Interest::matchesName(), ndn::nfd::operator==(), ndn::security::parse(), nfd::fw::Strategy::parseInstanceName(), nfd::pit::Pit::Pit(), ndn::mgmt::Dispatcher::removeTopPrefix(), ndn::InMemoryStorage::selectChild(), and ndn::nfd::StrategyChoiceUnsetCommand::validateRequest().
|
inline |
Get the component at the given index.
i | zero-based index; if negative, it starts at the end of this name |
Definition at line 164 of file name.hpp.
References size().
Referenced by compare(), ndn::security::v2::CertificateBundleFetcher::doFetch(), ndn::util::DummyClientFace::DummyClientFace(), equals(), ndn::util::SegmentFetcher::fetch(), isPrefixOf(), ndn::security::v2::isValidKeyName(), ndn::security::v2::Certificate::isValidName(), ndn::RegexRepeatMatcher::match(), ndn::RegexComponentSetMatcher::match(), ndn::RegexComponentMatcher::match(), ndn::RegexMatcher::match(), ndn::Interest::matchesData(), ndn::mgmt::Dispatcher::removeTopPrefix(), and ndn::util::NotificationSubscriberBase::stop().
|
inline |
Equivalent to get(i)
Definition at line 175 of file name.hpp.
References at(), getSubName(), and npos.
const name::Component & ndn::Name::at | ( | ssize_t | i | ) | const |
Get the component at the given index.
i | zero-based index; if negative, size()+i is used instead |
Name::Error | index is out of bounds |
Definition at line 185 of file name.cpp.
References ndn::Block::elements(), and size().
Referenced by append(), ndn::security::v2::ValidationPolicyCommandInterest::checkPolicy(), ndn::net::computePrefixLength(), nfd::rib::AutoPrefixPropagator::disable(), ndn::security::v2::CertificateBundleFetcher::doFetch(), nfd::ManagerBase::extractRequester(), ndn::security::v2::Certificate::getIssuerId(), ndn::security::v2::Certificate::getKeyId(), ndn::security::v2::getKeyLocatorName(), getSubName(), nfd::name_tree::NameTree::lookup(), nfd::fw::Strategy::makeInstanceName(), and operator[]().
PartialName ndn::Name::getSubName | ( | ssize_t | iStartComponent, |
size_t | nComponents = npos |
||
) | const |
Extract some components as a sub-name (PartialName)
iStartComponent | zero-based index of the first component; if negative, size()+iStartComponent is used instead |
nComponents | Number of components starting at iStartComponent. Use npos to get the PartialName until the end of this Name. |
If iStartComponent is positive and indexes out of bounds, returns an empty PartialName. If iStartComponent is negative and indexes out of bounds, returns components starting from the beginning of the Name. If nComponents is out of bounds, returns the components until the end of this Name.
Definition at line 199 of file name.cpp.
References append(), at(), npos, and size().
Referenced by getPrefix(), operator[](), and nfd::fw::Strategy::parseInstanceName().
|
inline |
Extract a prefix of the name.
nComponents | Number of components; if negative, size()+nComponents is used instead |
Definition at line 210 of file name.hpp.
References getSubName(), and size().
Referenced by nfd::fw::AccessStrategy::beforeSatisfyInterest(), ndn::security::v2::validator_config::Checker::check(), ndn::security::v2::ValidationPolicySimpleHierarchy::checkPolicy(), nfd::rib::AutoPrefixPropagator::disable(), ndn::security::v2::CertificateBundleFetcher::doFetch(), nfd::strategy_choice::StrategyChoice::erase(), ndn::security::v2::extractIdentityFromCertName(), ndn::security::v2::extractIdentityFromKeyName(), ndn::security::v2::extractKeyNameFromCertName(), ndn::util::SegmentFetcher::fetch(), nfd::cs::Cs::find(), nfd::rib::Rib::findParent(), ndn::security::v2::Certificate::getIdentity(), ndn::security::v2::Certificate::getKeyName(), nfd::fw::asf::AsfMeasurements::getOrCreateNamespaceInfo(), getSuccessor(), nfd::name_tree::NameTree::lookup(), ndn::security::v2::validator_config::Filter::match(), nfd::fw::Strategy::parseInstanceName(), nfd::pit::Pit::Pit(), ndn::InMemoryStorage::selectChild(), nfd::name_tree::Entry::setParent(), and nfd::name_tree::Hashtable::~Hashtable().
|
inline |
Begin iterator.
Definition at line 222 of file name.hpp.
Referenced by ndn::RegexTopMatcher::expand(), ndn::RegexTopMatcher::fromName(), and rend().
|
inline |
End iterator.
Definition at line 230 of file name.hpp.
Referenced by ndn::RegexTopMatcher::fromName(), and rbegin().
|
inline |
Reverse begin iterator.
Definition at line 238 of file name.hpp.
References end().
Referenced by nfd::fw::Strategy::makeInstanceName().
|
inline |
Reverse end iterator.
Definition at line 246 of file name.hpp.
References begin().
Referenced by nfd::fw::Strategy::makeInstanceName().
Append a component.
Definition at line 256 of file name.hpp.
References push_back().
Referenced by ndn::mgmt::Dispatcher::addNotificationStream(), ndn::mgmt::Dispatcher::addTopPrefix(), append(), appendImplicitSha256Digest(), appendNumber(), appendNumberWithMarker(), appendSegment(), appendSegmentOffset(), appendSequenceNumber(), appendTimestamp(), appendVersion(), ndn::security::v2::constructKeyName(), ndn::security::v2::CertificateBundleFetcher::doFetch(), ndn::RegexTopMatcher::expand(), ndn::nfd::FaceQueryDataset::FaceQueryDataset(), ndn::nfd::StatusDataset::getDatasetPrefix(), ndn::nfd::ControlCommand::getRequestName(), getSubName(), getSuccessor(), Name(), ndn::security::v2::parseLocatorUri(), ndn::security::CommandInterestPreparer::prepareCommandInterestName(), push_back(), and ndn::security::v2::KeyChain::sign().
|
inline |
Append a component, copying from a zero-terminated byte string.
value | a zero-terminated string; it will be constructed as a component as is and will not be interpreted as a URI |
append("string")
, because both Component and PartialName are implicitly convertible from zero-terminated byte string. This overload ensures the string is constructed as a Component. Definition at line 270 of file name.hpp.
References append().
|
inline |
|
inline |
Append a component, copying from [first
, last
)
Iterator | an InputIterator dereferencing to a one-octet value type. More efficient implementation is available when Iterator additionally satisfies RandomAccessIterator concept. |
first | begin position of the value |
last | end position of the value |
Definition at line 294 of file name.hpp.
References append().
Append a component, decoding from a Block.
value | a Block; if its TLV-TYPE is not NameComponent, it is nested into a NameComponent |
Definition at line 306 of file name.hpp.
References ndn::tlv::NameComponent, push_back(), and ndn::Block::type().
|
inline |
Append a component with a nonNegativeInteger.
Definition at line 324 of file name.hpp.
References append(), and ndn::name::Component::fromNumber().
Referenced by ndn::security::v2::CertificateBundleFetcher::doFetch().
|
inline |
Append a component with a marked number.
marker | 1-octet marker |
number | the number |
The component is encoded as a 1-octet marker, followed by a nonNegativeInteger.
Definition at line 339 of file name.hpp.
References append(), and ndn::name::Component::fromNumberWithMarker().
|
inline |
Append a version component.
Definition at line 349 of file name.hpp.
References append(), appendVersion(), and ndn::name::Component::fromVersion().
Referenced by ndn::security::v2::parseLocatorUri(), and ndn::mgmt::StatusDatasetContext::setPrefix().
Name & ndn::Name::appendVersion | ( | ) |
Append a version component based on current time.
The version number is the current UNIX timestamp in milliseconds
Definition at line 220 of file name.cpp.
References ndn::time::system_clock::now(), and ndn::time::toUnixTimestamp().
Referenced by appendVersion().
|
inline |
Append a segment number (sequential) component.
Definition at line 369 of file name.hpp.
References append(), and ndn::name::Component::fromSegment().
Referenced by ndn::util::SegmentFetcher::fetch().
|
inline |
Append a segment byte offset component.
Definition at line 379 of file name.hpp.
References append(), and ndn::name::Component::fromSegmentOffset().
|
inline |
Append a timestamp component.
Definition at line 389 of file name.hpp.
References append(), appendTimestamp(), and ndn::name::Component::fromTimestamp().
Name & ndn::Name::appendTimestamp | ( | ) |
Append a timestamp component based on current time.
Definition at line 226 of file name.cpp.
References ndn::time::system_clock::now().
Referenced by appendTimestamp().
|
inline |
Append a sequence number component.
Definition at line 406 of file name.hpp.
References append(), and ndn::name::Component::fromSequenceNumber().
Referenced by ndn::mgmt::Dispatcher::addNotificationStream(), ndn::util::NotificationStream< Notification >::postNotification(), and ndn::util::NotificationSubscriberBase::stop().
|
inline |
Append an ImplicitSha256Digest component.
Definition at line 415 of file name.hpp.
References append(), and ndn::name::Component::fromImplicitSha256Digest().
Referenced by ndn::Data::getFullName().
|
inline |
Append an ImplicitSha256Digest component.
Definition at line 424 of file name.hpp.
References append(), and ndn::name::Component::fromImplicitSha256Digest().
Name & ndn::Name::append | ( | const PartialName & | name | ) |
|
inline |
|
inline |
Remove all components.
Definition at line 450 of file name.hpp.
References equals(), getSuccessor(), isPrefixOf(), and ndn::tlv::Name.
Referenced by ndn::KeyLocator::clear(), ndn::security::pib::PibMemory::clearIdentities(), ndn::security::pib::PibMemory::removeIdentity(), ndn::Data::resetWire(), ndn::security::SigningInfo::setSha256Signing(), and ndn::Data::wireDecode().
Name ndn::Name::getSuccessor | ( | ) | const |
Get the successor of a name.
The successor of a name is defined as follows:
N represents the set of NDN Names, and X,Y ∈ N. Operator < is defined by canonical order on N. Y is the successor of X, if (a) X < Y, and (b) ∄ Z ∈ N s.t. X < Z < Y.
In plain words, successor of a name is the same name, but with its last component advanced to a next possible value.
Examples:
Definition at line 247 of file name.cpp.
References append(), empty(), and getPrefix().
Referenced by clear(), and nfd::cs::Cs::find().
bool ndn::Name::isPrefixOf | ( | const Name & | other | ) | const |
Check if this name is a prefix of another name.
This name is a prefix of other
if the N components of this name are same as the first N components of other
.
true | this name is a prefix of other |
false | this name is not a prefix of other |
Definition at line 260 of file name.cpp.
Referenced by ndn::mgmt::Dispatcher::addTopPrefix(), nfd::fw::asf::FaceInfo::cancelTimeoutEvent(), ndn::security::v2::validator_config::checkNameRelation(), ndn::security::v2::ValidationPolicySimpleHierarchy::checkPolicy(), clear(), nfd::rib::AutoPrefixPropagator::disable(), ndn::InterestFilter::doesMatch(), ndn::util::DummyClientFace::DummyClientFace(), ndn::InMemoryStorage::erase(), ndn::security::v2::CertificateCache::find(), ndn::security::v2::TrustAnchorContainer::find(), ndn::InMemoryStorage::find(), nfd::rib::Rib::findDescendants(), nfd::rib::Rib::findDescendantsForNonInsertedName(), nfd::Forwarder::Forwarder(), ndn::Interest::matchesData(), ndn::Interest::matchesName(), ndn::mgmt::Dispatcher::removeTopPrefix(), ndn::InMemoryStorage::selectChild(), ndn::mgmt::StatusDatasetContext::setPrefix(), and nfd::rib::NfdRibReadvertiseDestination::withdraw().
bool ndn::Name::equals | ( | const Name & | other | ) | const |
Check if this name equals another name.
Two names are equal if they have the same number of components, and components at each index are equal.
Definition at line 276 of file name.cpp.
Referenced by clear(), ndn::operator!=(), and ndn::operator==().
|
inline |
Compare this to the other Name using NDN canonical ordering.
If the first components of each name are not equal, this returns a negative value if the first comes before the second using the NDN canonical ordering for name components, or a positive value if it comes after. If they are equal, this compares the second components of each name, etc. If both names are the same up to the size of the shorter name, this returns a negative value if the first name is shorter than the second or a positive value if it is longer. For example, if you std::sort gives: /a/b/d /a/b/cc /c /c/a /bb . This is intuitive because all names with the prefix /a are next to each other. But it may be also be counter-intuitive because /c comes before /bb according to NDN canonical ordering since it is shorter.
other | The other Name to compare with. |
negative | this comes before other in canonical ordering |
zero | this equals other |
positive | this comes after other in canonical ordering |
Definition at line 520 of file name.hpp.
References npos.
Referenced by compare(), nfd::cs::compareDataWithData(), nfd::cs::compareQueryWithData(), ndn::operator<(), ndn::operator<=(), ndn::operator>(), ndn::operator>=(), and nfd::name_tree::Hashtable::~Hashtable().
|
static |
indicates "until the end" in getSubName and compare
Definition at line 537 of file name.hpp.
Referenced by nfd::pit::Entry::canMatch(), compare(), getSubName(), and operator[]().