NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.3: 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:

Public Member Functions

 Estimator (size_t totalReserve=0, size_t reserveFromBack=0)
 Create instance of the estimator. More...
 
 Estimator (const Estimator &)=delete
 
Estimatoroperator= (const Estimator &)=delete
 
size_t prependByte (uint8_t value)
 Prepend a byte. More...
 
size_t appendByte (uint8_t value)
 Append a byte. More...
 
size_t prependByteArray (const uint8_t *array, size_t length)
 Prepend a byte array array of length length. More...
 
size_t appendByteArray (const uint8_t *array, size_t length)
 Append a byte array array of length length. More...
 
template<class Iterator >
size_t prependRange (Iterator first, Iterator last)
 Prepend range of bytes from the range [first, last) More...
 
template<class Iterator >
size_t appendRange (Iterator first, Iterator last)
 Append range of bytes from the range [first, last) More...
 
size_t prependVarNumber (uint64_t varNumber)
 Prepend VarNumber varNumber of NDN TLV encoding. More...
 
size_t appendVarNumber (uint64_t varNumber)
 Prepend VarNumber varNumber of NDN TLV encoding. More...
 
size_t prependNonNegativeInteger (uint64_t integer)
 Prepend non-negative integer integer of NDN TLV encoding. More...
 
size_t appendNonNegativeInteger (uint64_t integer)
 Append non-negative integer integer of NDN TLV encoding. More...
 
size_t prependByteArrayBlock (uint32_t type, const uint8_t *array, size_t arraySize)
 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)
 Append TLV block of type type and value from buffer array of size arraySize. More...
 
size_t prependBlock (const Block &block)
 Prepend TLV block block. More...
 
size_t appendBlock (const Block &block)
 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 36 of file estimator.hpp.

Constructor & Destructor Documentation

ndn::encoding::Estimator::Estimator ( size_t  totalReserve = 0,
size_t  reserveFromBack = 0 
)
explicit

Create instance of the estimator.

Parameters
totalReservenot used (for compatibility with the Encoder)
reserveFromBacknot used (for compatibility with the Encoder)

Definition at line 27 of file estimator.cpp.

ndn::encoding::Estimator::Estimator ( const Estimator )
delete

Member Function Documentation

Estimator& ndn::encoding::Estimator::operator= ( const Estimator )
delete
size_t ndn::encoding::Estimator::prependByte ( uint8_t  value)

Prepend a byte.

Definition at line 32 of file estimator.cpp.

size_t ndn::encoding::Estimator::appendByte ( uint8_t  value)

Append a byte.

Definition at line 38 of file estimator.cpp.

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

Prepend a byte array array of length length.

Definition at line 45 of file estimator.cpp.

Referenced by appendByteArray().

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

Append a byte array array of length length.

Definition at line 51 of file estimator.cpp.

References prependByteArray().

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

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

Definition at line 146 of file estimator.hpp.

Referenced by appendRange().

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

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

Definition at line 154 of file estimator.hpp.

References prependRange().

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

Prepend VarNumber varNumber of NDN TLV encoding.

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

Definition at line 57 of file estimator.cpp.

Referenced by appendVarNumber(), ndn::encoding::detail::BinaryBlockFast< Iterator >::makeBlock(), and prependByteArrayBlock().

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

Prepend VarNumber varNumber of NDN TLV encoding.

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

Definition at line 74 of file estimator.cpp.

References prependVarNumber().

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

Prepend non-negative integer integer of NDN TLV encoding.

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

Definition at line 81 of file estimator.cpp.

Referenced by appendNonNegativeInteger(), and ndn::name::Component::fromNumberWithMarker().

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

Append non-negative integer integer of NDN TLV encoding.

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

Definition at line 98 of file estimator.cpp.

References prependNonNegativeInteger().

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

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

Definition at line 105 of file estimator.cpp.

References prependVarNumber().

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

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

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

Definition at line 115 of file estimator.cpp.

References prependByteArrayBlock().

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

Append TLV block block.

Definition at line 133 of file estimator.cpp.

References prependBlock().


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