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

Helper class to estimate size of TLV encoding Interface of this class (mostly) matches interface of Encoder class. More...

#include <estimator.hpp>

Inheritance diagram for ndn::encoding::Estimator:
Collaboration diagram for ndn::encoding::Estimator:

Public Member Functions

constexpr size_t prependByte (uint8_t) const noexcept
 Prepend a byte. More...
 
constexpr size_t appendByte (uint8_t) const noexcept
 Append a byte. More...
 
constexpr size_t prependByteArray (const uint8_t *, size_t length) const noexcept
 Prepend a byte array array of length length. More...
 
constexpr size_t appendByteArray (const uint8_t *, size_t length) const noexcept
 Append a byte array array of length length. More...
 
template<class Iterator >
size_t prependRange (Iterator first, Iterator last) const noexcept
 Prepend range of bytes from the range [first, last) More...
 
template<class Iterator >
size_t appendRange (Iterator first, Iterator last) const noexcept
 Append range of bytes from the range [first, last) More...
 
size_t prependVarNumber (uint64_t varNumber) const noexcept
 Prepend VarNumber varNumber of NDN TLV encoding. More...
 
size_t appendVarNumber (uint64_t varNumber) const noexcept
 Prepend VarNumber varNumber of NDN TLV encoding. More...
 
size_t prependNonNegativeInteger (uint64_t integer) const noexcept
 Prepend non-negative integer integer of NDN TLV encoding. More...
 
size_t appendNonNegativeInteger (uint64_t integer) const noexcept
 Append non-negative integer integer of NDN TLV encoding. More...
 
size_t prependByteArrayBlock (uint32_t type, const uint8_t *array, size_t arraySize) const noexcept
 Prepend TLV block of type type and value from buffer array of size arraySize. More...
 
size_t appendByteArrayBlock (uint32_t type, const uint8_t *array, size_t arraySize) const noexcept
 Append TLV block of type type and value from buffer array of size arraySize. More...
 
size_t prependBlock (const Block &block) const
 Prepend TLV block block. More...
 
size_t appendBlock (const Block &block) const
 Append TLV block block. More...
 

Detailed Description

Helper class to estimate size of TLV encoding Interface of this class (mostly) matches interface of Encoder class.

See also
Encoder

Definition at line 35 of file estimator.hpp.

Member Function Documentation

◆ prependByte()

constexpr size_t ndn::encoding::Estimator::prependByte ( uint8_t  ) const
inlineconstexprnoexcept

Prepend a byte.

Definition at line 42 of file estimator.hpp.

◆ appendByte()

constexpr size_t ndn::encoding::Estimator::appendByte ( uint8_t  ) const
inlineconstexprnoexcept

Append a byte.

Definition at line 51 of file estimator.hpp.

◆ prependByteArray()

constexpr size_t ndn::encoding::Estimator::prependByteArray ( const uint8_t *  ,
size_t  length 
) const
inlineconstexprnoexcept

Prepend a byte array array of length length.

Definition at line 60 of file estimator.hpp.

◆ appendByteArray()

constexpr size_t ndn::encoding::Estimator::appendByteArray ( const uint8_t *  ,
size_t  length 
) const
inlineconstexprnoexcept

Append a byte array array of length length.

Definition at line 69 of file estimator.hpp.

◆ prependRange()

template<class Iterator >
size_t ndn::encoding::Estimator::prependRange ( Iterator  first,
Iterator  last 
) const
inlinenoexcept

Prepend range of bytes from the range [first, last)

Definition at line 79 of file estimator.hpp.

◆ appendRange()

template<class Iterator >
size_t ndn::encoding::Estimator::appendRange ( Iterator  first,
Iterator  last 
) const
inlinenoexcept

Append range of bytes from the range [first, last)

Definition at line 89 of file estimator.hpp.

◆ prependVarNumber()

size_t ndn::encoding::Estimator::prependVarNumber ( uint64_t  varNumber) const
noexcept

Prepend VarNumber varNumber of NDN TLV encoding.

See also
http://named-data.net/doc/ndn-tlv/

Definition at line 28 of file estimator.cpp.

Referenced by ndn::encoding::detail::BinaryBlockFast< Iterator >::makeBlock().

◆ appendVarNumber()

size_t ndn::encoding::Estimator::appendVarNumber ( uint64_t  varNumber) const
noexcept

Prepend VarNumber varNumber of NDN TLV encoding.

See also
http://named-data.net/doc/ndn-tlv/

Definition at line 45 of file estimator.cpp.

◆ prependNonNegativeInteger()

size_t ndn::encoding::Estimator::prependNonNegativeInteger ( uint64_t  integer) const
noexcept

Prepend non-negative integer integer of NDN TLV encoding.

See also
http://named-data.net/doc/ndn-tlv/

Definition at line 51 of file estimator.cpp.

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

◆ appendNonNegativeInteger()

size_t ndn::encoding::Estimator::appendNonNegativeInteger ( uint64_t  integer) const
noexcept

Append non-negative integer integer of NDN TLV encoding.

See also
http://named-data.net/doc/ndn-tlv/

Definition at line 68 of file estimator.cpp.

◆ prependByteArrayBlock()

size_t ndn::encoding::Estimator::prependByteArrayBlock ( uint32_t  type,
const uint8_t *  array,
size_t  arraySize 
) const
noexcept

Prepend TLV block of type type and value from buffer array of size arraySize.

Definition at line 74 of file estimator.cpp.

Referenced by ndn::encoding::makeBinaryBlock(), and prependBlock().

◆ appendByteArrayBlock()

size_t ndn::encoding::Estimator::appendByteArrayBlock ( uint32_t  type,
const uint8_t *  array,
size_t  arraySize 
) const
noexcept

Append TLV block of type type and value from buffer array of size arraySize.

Definition at line 84 of file estimator.cpp.

◆ prependBlock()

size_t ndn::encoding::Estimator::prependBlock ( const Block block) const

◆ appendBlock()

size_t ndn::encoding::Estimator::appendBlock ( const Block block) const

Append TLV block block.

Definition at line 101 of file estimator.cpp.

References prependBlock().


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