A Name holds an array of Name::Component and represents an NDN name. More...
#include <name.hpp>
Data Structures | |
| class | Error |
| Error that can be thrown from Name. More... | |
Public Types | |
| typedef name::Component | Component |
| typedef std::vector< Component > | component_container |
| typedef Component | value_type |
| typedef void | allocator_type |
| typedef Component & | reference |
| typedef const Component | const_reference |
| typedef Component * | pointer |
| typedef const Component * | const_pointer |
| typedef Component * | iterator |
| typedef const Component * | const_iterator |
| typedef boost::reverse_iterator < iterator > | reverse_iterator |
| typedef boost::reverse_iterator < const_iterator > | const_reverse_iterator |
| typedef component_container::difference_type | difference_type |
| typedef component_container::size_type | size_type |
Public Member Functions | |
| Name () | |
| Create a new Name with no components. More... | |
| Name (const Block &wire) | |
| Create Name object from wire block. More... | |
| Name (const char *uri) | |
| Parse the uri according to the NDN URI Scheme and create the name with the components. More... | |
| Name (const std::string &uri) | |
| Parse the uri according to the NDN URI Scheme and create the name with the components. More... | |
| template<bool T> | |
| size_t | wireEncode (EncodingImpl< T > &block) const |
| Fast encoding or block size estimation. More... | |
| const Block & | wireEncode () const |
| void | wireDecode (const Block &wire) |
| bool | hasWire () const |
| Check if already has wire. More... | |
| void | set (const char *uri) |
| Parse the uri according to the NDN URI Scheme and set the name with the components. More... | |
| void | set (const std::string &uri) |
| Parse the uri according to the NDN URI Scheme and set the name with the components. More... | |
| Name & | append (const uint8_t *value, size_t valueLength) |
| Append a new component, copying from value of length valueLength. More... | |
| template<class InputIterator > | |
| Name & | append (InputIterator begin, InputIterator end) |
| Append a new component, copying from value of length valueLength. More... | |
| Name & | append (const ConstBufferPtr &value) |
| Name & | append (const Component &value) |
| Name & | append (const char *value) |
| Append name component that represented as a string. More... | |
| Name & | append (const Block &value) |
| Name & | append (const Name &name) |
| Append the components of the given name to this name. More... | |
| void | clear () |
| Clear all the components. More... | |
| Name | getSubName (size_t iStartComponent, size_t nComponents) const |
| Get a new name, constructed as a subset of components. More... | |
| Name | getSubName (size_t iStartComponent) const |
| Get a new name, constructed as a subset of components starting at iStartComponent until the end of the name. More... | |
| Name | getPrefix (int nComponents) const |
| Return a new Name with the first nComponents components of this Name. More... | |
| std::string | toUri () const |
| Encode this name as a URI. More... | |
| Name & | appendNumber (uint64_t number) |
| Append a component with the number encoded as nonNegativeInteger. More... | |
| Name & | appendVersion (uint64_t number) |
| An alias for appendNumber(uint64_t) More... | |
| Name & | appendVersion () |
| Append a component with the encoded version number (current UNIX timestamp in milliseconds) More... | |
| Name & | appendSegment (uint64_t number) |
| An alias for appendNumber(uint64_t) More... | |
| bool | equals (const Name &name) const |
| Check if this name has the same component count and components as the given name. More... | |
| bool | isPrefixOf (const Name &name) const |
| Check if the N components of this name are the same as the first N components of the given name. More... | |
| bool | empty () const |
| Check if name is emtpy. More... | |
| size_t | size () const |
| Get the 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 |
| const Component & | at (ssize_t i) const |
| Get component at the specified index. More... | |
| int | compare (const Name &other) const |
| Compare this to the other Name using NDN canonical ordering. More... | |
| template<class T > | |
| void | push_back (const T &component) |
| Append the component. More... | |
| bool | operator== (const Name &name) const |
| Check if this name has the same component count and components as the given name. More... | |
| bool | operator!= (const Name &name) const |
| Check if this name has the same component count and components as the given name. More... | |
| bool | operator<= (const Name &other) const |
| Return true if this is less than or equal to the other Name in the NDN canonical ordering. More... | |
| bool | operator< (const Name &other) const |
| Return true if this is less than the other Name in the NDN canonical ordering. More... | |
| bool | operator>= (const Name &other) const |
| Return true if this is less than or equal to the other Name in the NDN canonical ordering. More... | |
| bool | operator> (const Name &other) const |
| Return true if this is greater than the other Name in the NDN canonical ordering. More... | |
| const_iterator | begin () const |
| Begin iterator (const). More... | |
| const_iterator | end () const |
| End iterator (const). More... | |
| const_reverse_iterator | rbegin () const |
| Reverse begin iterator (const). More... | |
| const_reverse_iterator | rend () const |
| Reverse end iterator (const). More... | |
A Name holds an array of Name::Component and represents an NDN name.
| typedef void ndn::Name::allocator_type |
| typedef name::Component ndn::Name::Component |
| typedef std::vector<Component> ndn::Name::component_container |
| typedef const Component* ndn::Name::const_iterator |
| typedef const Component* ndn::Name::const_pointer |
| typedef const Component ndn::Name::const_reference |
| typedef boost::reverse_iterator<const_iterator> ndn::Name::const_reverse_iterator |
| typedef component_container::difference_type ndn::Name::difference_type |
| typedef Component* ndn::Name::iterator |
| typedef Component* ndn::Name::pointer |
| typedef Component& ndn::Name::reference |
| typedef boost::reverse_iterator<iterator> ndn::Name::reverse_iterator |
| typedef component_container::size_type ndn::Name::size_type |
| typedef Component ndn::Name::value_type |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Append a component with the number encoded as nonNegativeInteger.
| number | The non-negative number |
|
inline |
An alias for appendNumber(uint64_t)
|
inline |
An alias for appendNumber(uint64_t)
|
inline |
|
inline |
Get component at the specified index.
Unlike get() and operator[] methods, at() checks for out of bounds and will throw Name::Error when it happens
| Name::Error | if index out of bounds |
|
inline |
|
inline |
Compare this to the other Name using NDN canonical ordering.
If the first components of each name are not equal, this returns -1 if the first comes before the second using the NDN canonical ordering for name components, or 1 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 -1 if the first name is shorter than the second or 1 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. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |