NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::name::detail::DecimalComponentType Class Referencefinal

Rules for a component type holding a nonNegativeInteger value, written as a decimal number in URI representation. More...

#include <name-component-types.hpp>

Inheritance diagram for ndn::name::detail::DecimalComponentType:
Collaboration diagram for ndn::name::detail::DecimalComponentType:

Public Member Functions

 DecimalComponentType (uint32_t type, const std::string &typeName, const std::string &uriPrefix)
 
const char * getAltUriPrefix () const final
 Return the prefix of the alternate URI representation. More...
 
Component parseAltUriValue (const std::string &input) const final
 Parse component from alternate URI representation. More...
 
void writeUri (std::ostream &os, const Component &comp) const final
 Write URI representation of comp to os. More...
 
- Public Member Functions inherited from ndn::name::detail::ComponentType
virtual ~ComponentType ()=default
 
virtual void check (const Component &comp) const
 Throw Component::Error if comp is invalid. More...
 
virtual std::pair< bool, ComponentgetSuccessor (const Component &comp) const
 Calculate the successor of comp. More...
 
virtual const std::vector< uint8_t > & getMinValue () const
 Return the minimum allowable TLV-VALUE of this component type. More...
 

Additional Inherited Members

- Public Types inherited from ndn::name::detail::ComponentType
using Error = Component::Error
 
- Protected Member Functions inherited from ndn::name::detail::ComponentType
std::pair< bool, BlockgetSuccessorImpl (const Component &comp) const
 Calculate the successor of comp, extending TLV-LENGTH if value overflows. More...
 
void writeUriEscapedValue (std::ostream &os, const Component &comp) const
 Write TLV-VALUE as <escaped-value> of NDN URI syntax. More...
 

Detailed Description

Rules for a component type holding a nonNegativeInteger value, written as a decimal number in URI representation.

Definition at line 279 of file name-component-types.hpp.

Constructor & Destructor Documentation

◆ DecimalComponentType()

ndn::name::detail::DecimalComponentType::DecimalComponentType ( uint32_t  type,
const std::string &  typeName,
const std::string &  uriPrefix 
)
inline

Definition at line 282 of file name-component-types.hpp.

Member Function Documentation

◆ getAltUriPrefix()

const char* ndn::name::detail::DecimalComponentType::getAltUriPrefix ( ) const
inlinefinalvirtual

Return the prefix of the alternate URI representation.

NDN URI specification allows a name component type to declare an alternate URI representation in the form of <prefix>=<value>, in addition to the plain <type-number>=<escaped-value> syntax.

Returns
the <prefix> portion of the alternate URI representation.
Return values
nullptrthis component does not have an alternate URI representation.

Reimplemented from ndn::name::detail::ComponentType.

Definition at line 295 of file name-component-types.hpp.

◆ parseAltUriValue()

Component ndn::name::detail::DecimalComponentType::parseAltUriValue ( const std::string &  ) const
inlinefinalvirtual

Parse component from alternate URI representation.

Parameters
inputthe <value> portion of the alternate URI representation.
Exceptions
Component::Error
Precondition
getAltUriPrefix() != nullptr

Reimplemented from ndn::name::detail::ComponentType.

Definition at line 301 of file name-component-types.hpp.

References ndn::name::Component::fromNumber(), NDN_THROW, and ndn::to_string().

◆ writeUri()

void ndn::name::detail::DecimalComponentType::writeUri ( std::ostream &  os,
const Component comp 
) const
inlinefinalvirtual

Write URI representation of comp to os.

This base class implementation encodes the component in the plain <type-number>=<escaped-value> syntax.

Reimplemented from ndn::name::detail::ComponentType.

Definition at line 320 of file name-component-types.hpp.

References ndn::name::detail::ComponentType::writeUri().


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