|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
87 Name(
const char* uri);
93 Name(std::string uri);
119 template<encoding::Tag TAG>
167 i +=
static_cast<ssize_t
>(
size());
202 getSubName(ssize_t iStartComponent,
size_t nComponents =
npos)
const;
298 append(uint32_t type,
const uint8_t* value,
size_t count)
307 append(
const uint8_t* value,
size_t count)
320 template<
class Iterator>
322 append(uint32_t type, Iterator first, Iterator last)
334 template<
class Iterator>
602 compare(
size_t pos1,
size_t count1,
603 const Name& other,
size_t pos2 = 0,
size_t count2 =
npos)
const;
661 mutable Block m_wire;
685 #endif // NDN_NAME_HPP
const element_container & elements() const
Get container of sub-elements.
std::istream & operator>>(std::istream &is, Name &name)
Parse URI from stream as Name.
Name & appendImplicitSha256Digest(const uint8_t *digest, size_t digestSize)
Append an ImplicitSha256Digest component.
static Component fromNumber(uint64_t number, uint32_t type=tlv::GenericNameComponent)
Create a component encoded as nonNegativeInteger.
Name & append(const char *str)
Append a GenericNameComponent, copying TLV-VALUE from a null-terminated string.
static Component fromByteOffset(uint64_t offset)
Create byte offset component using NDN naming conventions.
bool hasWire() const
Check if this Name instance already has wire encoding.
@ DEFAULT
ALTERNATE, unless NDN_NAME_ALT_URI environment variable is set to '0'.
const_reverse_iterator rbegin() const
Reverse begin iterator.
static Component fromNumberWithMarker(uint8_t marker, uint64_t number)
Create a component encoded as NameComponentWithMarker.
Name & appendByteOffset(uint64_t offset)
Append a byte offset component.
void erase(ssize_t i)
Erase the component at the specified index.
int compare(const Name &other) const
Compare this to the other Name using NDN canonical ordering.
Name & appendSequenceNumber(uint64_t seqNo)
Append a sequence number component.
bool isPrefixOf(const Name &other) const
Check if this name is a prefix of another name.
Name()
Create an empty name.
size_t size() const
Returns the number of components.
NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(Interest)
component_container::difference_type difference_type
friend bool operator!=(const Name &lhs, const Name &rhs)
std::vector< Component > component_container
NDN_CXX_NODISCARD bool empty() const
Checks if the name is empty, i.e.
static const size_t npos
Indicates "until the end" in getSubName() and compare().
Name & appendParametersSha256Digest(ConstBufferPtr digest)
Append a ParametersSha256Digest component.
void push_back(const Block &element)
Append a sub-element.
static Component fromParametersSha256Digest(ConstBufferPtr digest)
Create ParametersSha256DigestComponent component.
Name getSuccessor() const
Get the successor of a name.
name::Component Component
Represents an absolute name.
void wireDecode(const Block &wire)
Decode name from wire encoding.
Name & appendParametersSha256Digest(const uint8_t *digest, size_t digestSize)
Append a ParametersSha256Digest component.
PartialName getSubName(ssize_t iStartComponent, size_t nComponents=npos) const
Extracts some components as a sub-name (PartialName).
const_reverse_iterator rend() const
Reverse end iterator.
#define NDN_CXX_NODISCARD
uint32_t type() const
Return the TLV-TYPE of the Block.
Name & appendVersion(optional< uint64_t > version=nullopt)
Append a version component.
friend bool operator<=(const Name &lhs, const Name &rhs)
Name & set(ssize_t i, const Component &component)
Replace the component at the specified index.
friend bool operator<(const Name &lhs, const Name &rhs)
Name & append(const Component &component)
Append a component.
PartialName getPrefix(ssize_t nComponents) const
Returns a prefix of the name.
static Component fromSegment(uint64_t segmentNo)
Create segment number component using NDN naming conventions.
const Block & wireEncode() const
Perform wire encoding, or return existing wire encoding.
static Component fromSequenceNumber(uint64_t seqNo)
Create sequence number component using NDN naming conventions.
Name & append(const uint8_t *value, size_t count)
Append a GenericNameComponent, copying count bytes at value as TLV-VALUE.
const nullopt_t nullopt((nullopt_t::init()))
void toUri(std::ostream &os, name::UriFormat format=name::UriFormat::DEFAULT) const
Write URI representation of the name to the output stream.
Name & append(Block value)
Append a GenericNameComponent from a TLV element.
friend bool operator>=(const Name &lhs, const Name &rhs)
const_iterator end() const
End iterator.
const Component & at(ssize_t i) const
Returns an immutable reference to the component at the specified index, with bounds checking.
friend bool operator>(const Name &lhs, const Name &rhs)
std::reverse_iterator< iterator > reverse_iterator
Name & appendParametersSha256DigestPlaceholder()
Append a placeholder for a ParametersSha256Digest component.
Represents a name component.
Represents a TLV element of NDN packet format.
size_t elements_size() const
Equivalent to elements().size()
const Component & operator[](ssize_t i) const
Equivalent to get(i).
friend std::ostream & operator<<(std::ostream &os, const Name &name)
Print URI representation of a name.
component_container::size_type size_type
Name & append(uint32_t type, Iterator first, Iterator last)
Append a NameComponent of TLV-TYPE type, copying TLV-VALUE from a range.
void clear()
Remove all components.
Name deepCopy() const
Make a deep copy of the name, reallocating the underlying memory buffer.
bool hasWire() const noexcept
Check if the Block contains a fully encoded wire representation.
static Component fromImplicitSha256Digest(ConstBufferPtr digest)
Create ImplicitSha256DigestComponent component.
Name & appendTimestamp(optional< time::system_clock::TimePoint > timestamp=nullopt)
Append a timestamp component.
Name & appendNumber(uint64_t number)
Append a component with a nonNegativeInteger.
Name & appendSegmentOffset(uint64_t offset)
const Component * const_iterator
void push_back(const T &component)
Append a component.
Name & appendSegment(uint64_t segmentNo)
Append a segment number (sequential) component.
const_iterator begin() const
Begin iterator.
const Component & get(ssize_t i) const
Returns an immutable reference to the component at the specified index.
Name & appendNumberWithMarker(uint8_t marker, uint64_t number)
Append a component with a marked number.
Name & append(Component &&component)
Append a component.
Name & appendImplicitSha256Digest(ConstBufferPtr digest)
Append an ImplicitSha256Digest component.
shared_ptr< const Buffer > ConstBufferPtr
Name & append(Iterator first, Iterator last)
Append a GenericNameComponent, copying TLV-VALUE from a range.
friend bool operator==(const Name &lhs, const Name &rhs)
Copyright (c) 2011-2015 Regents of the University of California.
bool equals(const Name &other) const
Check if this name equals another name.
Name & append(uint32_t type, const uint8_t *value, size_t count)
Append a NameComponent of TLV-TYPE type, copying count bytes at value as TLV-VALUE.
UriFormat
Identify a format of URI representation.
std::reverse_iterator< const_iterator > const_reverse_iterator