NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::name::Component Class Reference

Component holds a read-only name component value. More...

#include <name-component.hpp>

Inheritance diagram for ndn::name::Component:
Collaboration diagram for ndn::name::Component:

Classes

class  Error
 Error that can be thrown from name::Component. More...
 

Public Member Functions

 Component ()
 Create a new name::Component with an empty value. More...
 
 Component (const Block &wire)
 Create name::Component from a wire block. More...
 
 Component (const ConstBufferPtr &buffer)
 Create a new name::Component from the buffer pointer (buffer pointer will be copied) More...
 
 Component (const Buffer &buffer)
 Create a new name::Component from the buffer (data from buffer will be copied) More...
 
 Component (const uint8_t *buffer, size_t bufferSize)
 Create a new name::Component from the buffer (data from buffer will be copied) More...
 
template<class Iterator >
 Component (Iterator first, Iterator last)
 Create a new name::Component frome the range [first, last) of bytes. More...
 
 Component (const char *str)
 Create a new name::Component from the C string (data from string will be copied) More...
 
 Component (const std::string &str)
 Create a new name::Component from the STL string (data from string will be copied) More...
 
template<encoding::Tag TAG>
size_t wireEncode (EncodingImpl< TAG > &encoder) const
 Fast encoding or block size estimation. More...
 
const BlockwireEncode () const
 Encode to a wire format. More...
 
void wireDecode (const Block &wire)
 Decode from the wire format. More...
 
 DEPRECATED (void toEscapedString(std::ostream &os) const)
 Write *this to the output stream, escaping characters according to the NDN URI Scheme. More...
 
 DEPRECATED (std::string toEscapedString() const)
 Convert *this by escaping characters according to the NDN URI Scheme. More...
 
void toUri (std::ostream &os) const
 Write *this to the output stream, escaping characters according to the NDN URI Scheme. More...
 
std::string toUri () const
 Convert *this by escaping characters according to the NDN URI Scheme. More...
 
bool isNumber () const
 Check if the component is nonNegativeInteger. More...
 
bool isNumberWithMarker (uint8_t marker) const
 Check if the component is NameComponentWithMarker per NDN naming conventions. More...
 
bool isVersion () const
 Check if the component is version per NDN naming conventions. More...
 
bool isSegment () const
 Check if the component is segment number per NDN naming conventions. More...
 
bool isSegmentOffset () const
 Check if the component is segment offset per NDN naming conventions. More...
 
bool isTimestamp () const
 Check if the component is timestamp per NDN naming conventions. More...
 
bool isSequenceNumber () const
 Check if the component is sequence number per NDN naming conventions. More...
 
uint64_t toNumber () const
 Interpret this name component as nonNegativeInteger. More...
 
uint64_t toNumberWithMarker (uint8_t marker) const
 Interpret this name component as NameComponentWithMarker. More...
 
uint64_t toVersion () const
 Interpret as version component using NDN naming conventions. More...
 
uint64_t toSegment () const
 Interpret as segment number component using NDN naming conventions. More...
 
uint64_t toSegmentOffset () const
 Interpret as segment offset component using NDN naming conventions. More...
 
time::system_clock::TimePoint toTimestamp () const
 Interpret as timestamp component using NDN naming conventions. More...
 
uint64_t toSequenceNumber () const
 Interpret as sequence number component using NDN naming conventions. More...
 
bool isGeneric () const
 Check if the component is GenericComponent. More...
 
bool isImplicitSha256Digest () const
 Check if the component is ImplicitSha256DigestComponent. More...
 
bool empty () const
 
Component getSuccessor () const
 
bool equals (const Component &other) const
 Check if this is the same component as other. More...
 
int compare (const Component &other) const
 Compare this to the other Component using NDN canonical ordering. More...
 
bool operator== (const Component &other) const
 Check if this is the same component as other. More...
 
bool operator!= (const Component &other) const
 Check if this is not the same component as other. More...
 
bool operator<= (const Component &other) const
 Check if the *this is less than or equal to the other in NDN canonical ordering. More...
 
bool operator< (const Component &other) const
 Check if the *this is less than the other in NDN canonical ordering. More...
 
bool operator>= (const Component &other) const
 Check if the *this is greater or equal than the other in NDN canonical ordering. More...
 
bool operator> (const Component &other) const
 Check if the *this is greater than the other in NDN canonical ordering. More...
 
- Public Member Functions inherited from ndn::Block
 Block ()
 Create an empty Block. More...
 
 Block (const EncodingBuffer &buffer)
 Create a Block based on EncodingBuffer object. More...
 
 Block (const ConstBufferPtr &buffer)
 Create a Block from the raw buffer with Type-Length parsing. More...
 
 Block (const ConstBufferPtr &buffer, const Buffer::const_iterator &begin, const Buffer::const_iterator &end, bool verifyLength=true)
 Create a Block from a buffer, directly specifying boundaries of the block within the buffer. More...
 
 Block (const Block &block, const Buffer::const_iterator &begin, const Buffer::const_iterator &end, bool verifyLength=true)
 Create a Block from existing block (reusing the underlying buffer), directly specifying boundaries of the block within the buffer. More...
 
 Block (const uint8_t *buffer, size_t maxlength)
 Create a Block from the raw buffer with Type-Length parsing. More...
 
 Block (const void *buffer, size_t maxlength)
 Create a Block from the raw buffer with Type-Length parsing. More...
 
 Block (const ConstBufferPtr &wire, uint32_t type, const Buffer::const_iterator &begin, const Buffer::const_iterator &end, const Buffer::const_iterator &valueBegin, const Buffer::const_iterator &valueEnd)
 Create a Block from the wire buffer (no parsing) More...
 
 Block (uint32_t type)
 Create Block of a specific type with empty wire buffer. More...
 
 Block (uint32_t type, const ConstBufferPtr &value)
 Create a Block of a specific type with the specified value. More...
 
 Block (uint32_t type, const Block &value)
 Create a nested Block of a specific type with the specified value. More...
 
 DEPRECATED (static bool fromBuffer(const ConstBufferPtr &buffer, size_t offset, Block &block))
 
 DEPRECATED (static bool fromBuffer(const uint8_t *buffer, size_t maxSize, Block &block))
 
bool empty () const
 Check if the Block is empty. More...
 
bool hasWire () const
 Check if the Block has fully encoded wire. More...
 
void reset ()
 Reset wire buffer of the element. More...
 
void resetWire ()
 Reset wire buffer but keep sub elements (if any) More...
 
Buffer::const_iterator begin () const
 
Buffer::const_iterator end () const
 
const uint8_t * wire () const
 
size_t size () const
 
uint32_t type () const
 
bool hasValue () const
 Check if the Block has value block (no type and length are encoded) More...
 
Buffer::const_iterator value_begin () const
 
Buffer::const_iterator value_end () const
 
const uint8_t * value () const
 
size_t value_size () const
 
void parse () const
 Parse wire buffer into subblocks. More...
 
void encode ()
 Encode subblocks into wire buffer. More...
 
const Blockget (uint32_t type) const
 Get the first subelement of the requested type. More...
 
element_const_iterator find (uint32_t type) const
 
void remove (uint32_t type)
 remove all subelements of type More...
 
element_iterator erase (element_const_iterator position)
 
element_iterator erase (element_const_iterator first, element_const_iterator last)
 
void push_back (const Block &element)
 
element_iterator insert (element_const_iterator pos, const Block &element)
 insert Insert a new element in a specific position More...
 
const element_containerelements () const
 Get all subelements. More...
 
element_const_iterator elements_begin () const
 
element_const_iterator elements_end () const
 
size_t elements_size () const
 
Block blockFromValue () const
 
shared_ptr< const BuffergetBuffer () const
 Get underlying buffer. More...
 
bool operator== (const Block &other) const
 
bool operator!= (const Block &other) const
 
 operator boost::asio::const_buffer () const
 

Static Public Member Functions

static Component fromEscapedString (const char *escapedString, size_t beginOffset, size_t endOffset)
 Create name::Component by decoding the escapedString between beginOffset and endOffset according to the NDN URI Scheme. More...
 
static Component fromEscapedString (const char *escapedString)
 Create name::Component by decoding the escapedString according to the NDN URI Scheme. More...
 
static Component fromEscapedString (const std::string &escapedString)
 Create name::Component by decoding the escapedString according to the NDN URI Scheme. More...
 
static Component fromNumber (uint64_t number)
 Create a component encoded as nonNegativeInteger. More...
 
static Component fromNumberWithMarker (uint8_t marker, uint64_t number)
 Create a component encoded as NameComponentWithMarker. More...
 
static Component fromVersion (uint64_t version)
 Create version component using NDN naming conventions. More...
 
static Component fromSegment (uint64_t segmentNo)
 Create segment number component using NDN naming conventions. More...
 
static Component fromSegmentOffset (uint64_t offset)
 Create segment offset component using NDN naming conventions. More...
 
static Component fromTimestamp (const time::system_clock::TimePoint &timePoint)
 Create sequence number component using NDN naming conventions. More...
 
static Component fromSequenceNumber (uint64_t seqNo)
 Create sequence number component using NDN naming conventions. More...
 
static Component fromImplicitSha256Digest (const ConstBufferPtr &digest)
 Create ImplicitSha256DigestComponent component. More...
 
static Component fromImplicitSha256Digest (const uint8_t *digest, size_t digestSize)
 Create ImplicitSha256DigestComponent component. More...
 
- Static Public Member Functions inherited from ndn::Block
static Block fromStream (std::istream &is)
 Create a Block from an input stream. More...
 
static std::tuple< bool, BlockfromBuffer (ConstBufferPtr buffer, size_t offset)
 Try to construct block from Buffer. More...
 
static std::tuple< bool, BlockfromBuffer (const uint8_t *buffer, size_t maxSize)
 Try to construct block from raw buffer. More...
 

Additional Inherited Members

- Public Types inherited from ndn::Block
typedef std::vector< Blockelement_container
 
typedef element_container::iterator element_iterator
 
typedef element_container::const_iterator element_const_iterator
 
- Protected Attributes inherited from ndn::Block
shared_ptr< const Bufferm_buffer
 
uint32_t m_type
 
Buffer::const_iterator m_begin
 
Buffer::const_iterator m_end
 
uint32_t m_size
 
Buffer::const_iterator m_value_begin
 
Buffer::const_iterator m_value_end
 
element_container m_subBlocks
 

Detailed Description

Component holds a read-only name component value.

Definition at line 47 of file name-component.hpp.

Constructor & Destructor Documentation

§ Component() [1/8]

ndn::name::Component::Component ( )

Create a new name::Component with an empty value.

Definition at line 53 of file name-component.cpp.

Referenced by ndn::name::Component::Error::Error(), and fromEscapedString().

§ Component() [2/8]

ndn::name::Component::Component ( const Block wire)

Create name::Component from a wire block.

Parameters
wiretlv::NameComponent Block from which to create name::Component
Exceptions
Errorif wire.type() is not tlv::NameComponent

Any block can be implicitly converted to name::Component

Definition at line 58 of file name-component.cpp.

References isGeneric(), and isImplicitSha256Digest().

§ Component() [3/8]

ndn::name::Component::Component ( const ConstBufferPtr buffer)
explicit

Create a new name::Component from the buffer pointer (buffer pointer will be copied)

Parameters
bufferA pointer to an immutable buffer

This constructor will create a new tlv::NameComponent Block with buffer as a payload. Note that this method will not allocate new memory for and copy the payload until toWire() method is called.

Definition at line 66 of file name-component.cpp.

§ Component() [4/8]

ndn::name::Component::Component ( const Buffer buffer)
explicit

Create a new name::Component from the buffer (data from buffer will be copied)

Parameters
bufferA reference to the buffer

This constructor will create a new tlv::NameComponent Block with buffer as a payload. Note that this method will allocate new memory for and copy the payload.

Definition at line 71 of file name-component.cpp.

§ Component() [5/8]

ndn::name::Component::Component ( const uint8_t *  buffer,
size_t  bufferSize 
)

Create a new name::Component from the buffer (data from buffer will be copied)

Parameters
bufferA pointer to the first byte of the buffer
bufferSizeSize of the buffer

This constructor will create a new tlv::NameComponent Block with buffer as a payload. Note that this method will allocate new memory for and copy the payload.

Definition at line 76 of file name-component.cpp.

§ Component() [6/8]

template<class Iterator >
ndn::name::Component::Component ( Iterator  first,
Iterator  last 
)
inline

Create a new name::Component frome the range [first, last) of bytes.

Parameters
firstIterator pointing to the beginning of the buffer
lastIterator pointing to the ending of the buffer
Template Parameters
Iteratoriterator type satisfying at least InputIterator concept. Implementation is more optimal when the iterator type satisfies RandomAccessIterator concept. It is required that sizeof(std::iterator_traits<Iterator>::value_type) == 1.

This constructor will create a new tlv::NameComponent Block with buffer as a payload. Note that this method will allocate new memory for and copy the payload.

Definition at line 621 of file name-component.hpp.

§ Component() [7/8]

ndn::name::Component::Component ( const char *  str)
explicit

Create a new name::Component from the C string (data from string will be copied)

Parameters
strZero-ended string. Note that this string will be interpreted as is (i.e., it will not be interpreted as URI)

This constructor will create a new tlv::NameComponent Block with buffer as a payload. Note that this method will allocate new memory for and copy the payload.

Definition at line 81 of file name-component.cpp.

§ Component() [8/8]

ndn::name::Component::Component ( const std::string &  str)
explicit

Create a new name::Component from the STL string (data from string will be copied)

Parameters
strConst reference to STL string. Note that this string will be interpreted as is (i.e., it will not be interpreted as URI)

This constructor will create a new tlv::NameComponent Block with buffer as a payload. Note that this method will allocate new memory for and copy the payload.

Definition at line 86 of file name-component.cpp.

Member Function Documentation

§ wireEncode() [1/2]

template<encoding::Tag TAG>
size_t ndn::name::Component::wireEncode ( EncodingImpl< TAG > &  encoder) const

Fast encoding or block size estimation.

Definition at line 437 of file name-component.cpp.

References ndn::Block::type(), ndn::Block::value(), and ndn::Block::value_size().

§ wireEncode() [2/2]

const Block & ndn::name::Component::wireEncode ( ) const

Encode to a wire format.

Definition at line 454 of file name-component.cpp.

References ndn::Block::hasWire().

Referenced by ndn::name::Component::Error::Error().

§ wireDecode()

void ndn::name::Component::wireDecode ( const Block wire)

Decode from the wire format.

Definition at line 470 of file name-component.cpp.

References ndn::Block::wire().

Referenced by ndn::name::Component::Error::Error().

§ fromEscapedString() [1/3]

Component ndn::name::Component::fromEscapedString ( const char *  escapedString,
size_t  beginOffset,
size_t  endOffset 
)
static

Create name::Component by decoding the escapedString between beginOffset and endOffset according to the NDN URI Scheme.

If the escaped string is "", "." or ".." then return an empty name::Component. Note that an empty name::Component should not be added to Name and if attempted, an exception will be thrown.

Parameters
escapedStringString containing NDN URI-encoded name component. [escapedString+beginOffset, beginOffset+endOffset) must be a valid memory buffer.
beginOffsetThe offset in escapedString of the beginning of the portion to decode.
endOffsetThe offset in escapedString of the end of the portion to decode.

Definition at line 93 of file name-component.cpp.

References Component(), ndn::fromHex(), fromImplicitSha256Digest(), ndn::name::getSha256DigestUriPrefix(), ndn::crypto::SHA256_DIGEST_SIZE, ndn::Block::size(), ndn::trim(), ndn::unescape(), and ndn::Block::value().

Referenced by ndn::name::Component::Error::Error(), fromEscapedString(), and ndn::Name::wireDecode().

§ fromEscapedString() [2/3]

static Component ndn::name::Component::fromEscapedString ( const char *  escapedString)
inlinestatic

Create name::Component by decoding the escapedString according to the NDN URI Scheme.

This overload is a convenience wrapper for fromEscapedString(char*,size_t,size)

Definition at line 190 of file name-component.hpp.

References fromEscapedString().

§ fromEscapedString() [3/3]

static Component ndn::name::Component::fromEscapedString ( const std::string &  escapedString)
inlinestatic

Create name::Component by decoding the escapedString according to the NDN URI Scheme.

This overload is a convenience wrapper for fromEscapedString(char*,size_t,size)

Definition at line 201 of file name-component.hpp.

References fromEscapedString().

§ DEPRECATED() [1/2]

ndn::name::Component::DEPRECATED ( void toEscapedString(std::ostream &os)  const)
inline

Write *this to the output stream, escaping characters according to the NDN URI Scheme.

Deprecated:
Use toUri(std::ostream&) instead

This also adds "..." to a value with zero or more "."

Parameters
osThe output stream to where write the URI escaped version *this

Definition at line 215 of file name-component.hpp.

References toUri().

§ DEPRECATED() [2/2]

ndn::name::Component::DEPRECATED ( std::string toEscapedString()  const)
inline

§ toUri() [1/2]

§ toUri() [2/2]

std::string ndn::name::Component::toUri ( ) const

Convert *this by escaping characters according to the NDN URI Scheme.

This also adds "..." to a value with zero or more "."

Returns
The escaped string

Definition at line 182 of file name-component.cpp.

Referenced by DEPRECATED().

§ isNumber()

bool ndn::name::Component::isNumber ( ) const

Check if the component is nonNegativeInteger.

See also
http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding

Definition at line 192 of file name-component.cpp.

References ndn::Block::value_size().

Referenced by DEPRECATED(), and toNumber().

§ isNumberWithMarker()

bool ndn::name::Component::isNumberWithMarker ( uint8_t  marker) const

Check if the component is NameComponentWithMarker per NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 199 of file name-component.cpp.

References empty(), ndn::Block::value(), and ndn::Block::value_size().

Referenced by DEPRECATED(), isSegment(), isSegmentOffset(), isSequenceNumber(), isTimestamp(), isVersion(), and toNumberWithMarker().

§ isVersion()

bool ndn::name::Component::isVersion ( ) const

Check if the component is version per NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 207 of file name-component.cpp.

References isNumberWithMarker(), and ndn::name::VERSION_MARKER.

Referenced by DEPRECATED().

§ isSegment()

bool ndn::name::Component::isSegment ( ) const

Check if the component is segment number per NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 213 of file name-component.cpp.

References isNumberWithMarker(), and ndn::name::SEGMENT_MARKER.

Referenced by DEPRECATED(), and ndn::util::SegmentFetcher::fetch().

§ isSegmentOffset()

bool ndn::name::Component::isSegmentOffset ( ) const

Check if the component is segment offset per NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 219 of file name-component.cpp.

References isNumberWithMarker(), and ndn::name::SEGMENT_OFFSET_MARKER.

Referenced by DEPRECATED().

§ isTimestamp()

bool ndn::name::Component::isTimestamp ( ) const

Check if the component is timestamp per NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 225 of file name-component.cpp.

References isNumberWithMarker(), and ndn::name::TIMESTAMP_MARKER.

Referenced by DEPRECATED().

§ isSequenceNumber()

bool ndn::name::Component::isSequenceNumber ( ) const

Check if the component is sequence number per NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 231 of file name-component.cpp.

References isNumberWithMarker(), and ndn::name::SEQUENCE_NUMBER_MARKER.

Referenced by DEPRECATED().

§ toNumber()

uint64_t ndn::name::Component::toNumber ( ) const

Interpret this name component as nonNegativeInteger.

See also
http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding
Returns
The integer number.

Definition at line 239 of file name-component.cpp.

References isNumber(), and ndn::encoding::readNonNegativeInteger().

Referenced by ndn::ValidatorConfig::checkPolicy(), ndn::CommandInterestValidator::checkPolicy(), and DEPRECATED().

§ toNumberWithMarker()

uint64_t ndn::name::Component::toNumberWithMarker ( uint8_t  marker) const

Interpret this name component as NameComponentWithMarker.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf
Parameters
marker1-byte octet of the marker
Returns
The integer number.
Exceptions
Errorif name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification.

Definition at line 248 of file name-component.cpp.

References isNumberWithMarker(), ndn::tlv::readNonNegativeInteger(), ndn::Block::value_begin(), ndn::Block::value_end(), and ndn::Block::value_size().

Referenced by DEPRECATED(), toSegment(), toSegmentOffset(), toSequenceNumber(), toTimestamp(), and toVersion().

§ toVersion()

uint64_t ndn::name::Component::toVersion ( ) const

Interpret as version component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf
Exceptions
Errorif name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification.

Definition at line 259 of file name-component.cpp.

References toNumberWithMarker(), and ndn::name::VERSION_MARKER.

Referenced by DEPRECATED().

§ toSegment()

uint64_t ndn::name::Component::toSegment ( ) const

Interpret as segment number component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf
Exceptions
Errorif name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification.

Definition at line 265 of file name-component.cpp.

References ndn::name::SEGMENT_MARKER, and toNumberWithMarker().

Referenced by DEPRECATED(), nfd::rib::RibManager::enableLocalControlHeader(), and ndn::util::SegmentFetcher::fetch().

§ toSegmentOffset()

uint64_t ndn::name::Component::toSegmentOffset ( ) const

Interpret as segment offset component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf
Exceptions
Errorif name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification.

Definition at line 271 of file name-component.cpp.

References ndn::name::SEGMENT_OFFSET_MARKER, and toNumberWithMarker().

Referenced by DEPRECATED().

§ toTimestamp()

time::system_clock::TimePoint ndn::name::Component::toTimestamp ( ) const

Interpret as timestamp component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf
Exceptions
Errorif name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification.

Definition at line 277 of file name-component.cpp.

References ndn::time::getUnixEpoch(), ndn::name::TIMESTAMP_MARKER, toNumberWithMarker(), and ndn::Block::value().

Referenced by DEPRECATED().

§ toSequenceNumber()

uint64_t ndn::name::Component::toSequenceNumber ( ) const

Interpret as sequence number component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf
Exceptions
Errorif name component does not have the specified marker. tlv::Error if format does not follow NameComponentWithMarker specification.

Definition at line 284 of file name-component.cpp.

References ndn::name::SEQUENCE_NUMBER_MARKER, and toNumberWithMarker().

Referenced by DEPRECATED().

§ fromNumber()

Component ndn::name::Component::fromNumber ( uint64_t  number)
static

Create a component encoded as nonNegativeInteger.

See also
http://named-data.net/doc/ndn-tlv/tlv.html#non-negative-integer-encoding
Parameters
numberThe non-negative number
Returns
The component value.

Definition at line 292 of file name-component.cpp.

References ndn::encoding::makeNonNegativeIntegerBlock(), and ndn::tlv::NameComponent.

Referenced by ndn::Name::appendNumber(), DEPRECATED(), ndn::security::KeyChain::getDefaultKeyParamsForIdentity(), and ndn::security::KeyChain::signWithSha256().

§ fromNumberWithMarker()

Component ndn::name::Component::fromNumberWithMarker ( uint8_t  marker,
uint64_t  number 
)
static

Create a component encoded as NameComponentWithMarker.

NameComponentWithMarker is defined as:

NameComponentWithMarker ::= NAME-COMPONENT-TYPE TLV-LEGTH
                              Marker
                              includedNonNegativeInteger
Marker ::= BYTE
includedNonNegativeInteger ::= BYTE{1,2,4,8}
NDN-TLV := TLV-TYPE TLV-LENGTH TLV-VALUE?
TLV-TYPE := VAR-NUMBER
TLV-LENGTH := VAR-NUMBER
TLV-VALUE := BYTE+
See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf
Parameters
marker1-byte marker octet
numberThe non-negative number
Returns
The component value.

Definition at line 298 of file name-component.cpp.

References ndn::tlv::NameComponent, and ndn::encoding::Estimator::prependNonNegativeInteger().

Referenced by ndn::Name::appendNumberWithMarker(), DEPRECATED(), fromSegment(), fromSegmentOffset(), fromSequenceNumber(), fromTimestamp(), and fromVersion().

§ fromVersion()

Component ndn::name::Component::fromVersion ( uint64_t  version)
static

Create version component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 318 of file name-component.cpp.

References fromNumberWithMarker(), and ndn::name::VERSION_MARKER.

Referenced by ndn::Name::appendVersion(), and DEPRECATED().

§ fromSegment()

Component ndn::name::Component::fromSegment ( uint64_t  segmentNo)
static

Create segment number component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 324 of file name-component.cpp.

References fromNumberWithMarker(), and ndn::name::SEGMENT_MARKER.

Referenced by ndn::Name::appendSegment(), and DEPRECATED().

§ fromSegmentOffset()

Component ndn::name::Component::fromSegmentOffset ( uint64_t  offset)
static

Create segment offset component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 330 of file name-component.cpp.

References fromNumberWithMarker(), and ndn::name::SEGMENT_OFFSET_MARKER.

Referenced by ndn::Name::appendSegmentOffset(), and DEPRECATED().

§ fromTimestamp()

Component ndn::name::Component::fromTimestamp ( const time::system_clock::TimePoint timePoint)
static

Create sequence number component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 336 of file name-component.cpp.

References fromNumberWithMarker(), ndn::time::getUnixEpoch(), ndn::name::TIMESTAMP_MARKER, and ndn::Block::value().

Referenced by ndn::Name::appendTimestamp(), and DEPRECATED().

§ fromSequenceNumber()

Component ndn::name::Component::fromSequenceNumber ( uint64_t  seqNo)
static

Create sequence number component using NDN naming conventions.

See also
http://named-data.net/doc/tech-memos/naming-conventions.pdf

Definition at line 344 of file name-component.cpp.

References fromNumberWithMarker(), and ndn::name::SEQUENCE_NUMBER_MARKER.

Referenced by ndn::Name::appendSequenceNumber(), and DEPRECATED().

§ isGeneric()

bool ndn::name::Component::isGeneric ( ) const

Check if the component is GenericComponent.

Definition at line 352 of file name-component.cpp.

References ndn::tlv::NameComponent, and ndn::Block::type().

Referenced by Component(), and DEPRECATED().

§ isImplicitSha256Digest()

bool ndn::name::Component::isImplicitSha256Digest ( ) const

§ fromImplicitSha256Digest() [1/2]

Component ndn::name::Component::fromImplicitSha256Digest ( const ConstBufferPtr digest)
static

§ fromImplicitSha256Digest() [2/2]

Component ndn::name::Component::fromImplicitSha256Digest ( const uint8_t *  digest,
size_t  digestSize 
)
static

Create ImplicitSha256DigestComponent component.

Definition at line 375 of file name-component.cpp.

References ndn::tlv::ImplicitSha256DigestComponent, ndn::encoding::makeBinaryBlock(), ndn::crypto::SHA256_DIGEST_SIZE, and ndn::to_string().

§ empty()

§ getSuccessor()

Component ndn::name::Component::getSuccessor ( ) const

§ equals()

bool ndn::name::Component::equals ( const Component other) const
inline

Check if this is the same component as other.

Parameters
otherThe other Component to compare with
Returns
true if the components are equal, otherwise false.

Definition at line 510 of file name-component.hpp.

References compare(), ndn::Block::value_begin(), ndn::Block::value_end(), and ndn::Block::value_size().

Referenced by operator!=(), and operator==().

§ compare()

int ndn::name::Component::compare ( const Component other) const

Compare this to the other Component using NDN canonical ordering.

Parameters
otherThe other Component to compare with.
Return values
negativethis comes before other in canonical ordering
zerothis equals other
positivethis comes after other in canonical ordering
See also
http://named-data.net/doc/ndn-tlv/name.html#canonical-order

Definition at line 387 of file name-component.cpp.

References ndn::Block::type(), ndn::Block::value(), and ndn::Block::value_size().

Referenced by ndn::Name::compare(), equals(), ndn::SecRuleRelative::matchSignerName(), operator<(), operator<=(), operator>(), and operator>=().

§ operator==()

bool ndn::name::Component::operator== ( const Component other) const
inline

Check if this is the same component as other.

Parameters
otherThe other Component to compare with.
Returns
true if the components are equal, otherwise false.

Definition at line 542 of file name-component.hpp.

References equals().

§ operator!=()

bool ndn::name::Component::operator!= ( const Component other) const
inline

Check if this is not the same component as other.

Parameters
otherThe other Component to compare with
Returns
true if the components are not equal, otherwise false

Definition at line 553 of file name-component.hpp.

References equals().

§ operator<=()

bool ndn::name::Component::operator<= ( const Component other) const
inline

Check if the *this is less than or equal to the other in NDN canonical ordering.

Parameters
otherThe other Component to compare with
See also
http://named-data.net/doc/ndn-tlv/name.html#canonical-order

Definition at line 565 of file name-component.hpp.

References compare().

§ operator<()

bool ndn::name::Component::operator< ( const Component other) const
inline

Check if the *this is less than the other in NDN canonical ordering.

Parameters
otherThe other Component to compare with
See also
http://named-data.net/doc/ndn-tlv/name.html#canonical-order

Definition at line 577 of file name-component.hpp.

References compare().

§ operator>=()

bool ndn::name::Component::operator>= ( const Component other) const
inline

Check if the *this is greater or equal than the other in NDN canonical ordering.

Parameters
otherThe other Component to compare with
See also
http://named-data.net/doc/ndn-tlv/name.html#canonical-order

Definition at line 589 of file name-component.hpp.

References compare().

§ operator>()

bool ndn::name::Component::operator> ( const Component other) const
inline

Check if the *this is greater than the other in NDN canonical ordering.

Parameters
otherThe other Component to compare with
See also
http://named-data.net/doc/ndn-tlv/name.html#canonical-order

Definition at line 601 of file name-component.hpp.

References compare().


The documentation for this class was generated from the following files: