22 #ifndef NDN_ENCODING_ESTIMATOR_HPP 23 #define NDN_ENCODING_ESTIMATOR_HPP 25 #include "../common.hpp" 45 Estimator(
size_t totalReserve = 0,
size_t reserveFromBack = 0);
79 template<
class Iterator>
86 template<
class Iterator>
144 template<
class Iterator>
148 return std::distance(first, last);
152 template<
class Iterator>
162 #endif // NDN_ENCODING_ESTIMATOR_HPP size_t prependRange(Iterator first, Iterator last)
Prepend range of bytes from the range [first, last)
Copyright (c) 2013-2017 Regents of the University of California.
Estimator & operator=(const Estimator &)=delete
size_t prependByte(uint8_t value)
Prepend a byte.
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.
Represents a TLV element of NDN packet format.
size_t appendByteArray(const uint8_t *array, size_t length)
Append a byte array array of length length.
size_t prependByteArray(const uint8_t *array, size_t length)
Prepend a byte array array of length length.
size_t appendRange(Iterator first, Iterator last)
Append range of bytes from the range [first, last)
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.
size_t prependVarNumber(uint64_t varNumber)
Prepend VarNumber varNumber of NDN TLV encoding.
size_t appendNonNegativeInteger(uint64_t integer)
Append non-negative integer integer of NDN TLV encoding.
Estimator(size_t totalReserve=0, size_t reserveFromBack=0)
Create instance of the estimator.
size_t prependBlock(const Block &block)
Prepend TLV block block.
size_t appendBlock(const Block &block)
Append TLV block block.
size_t appendByte(uint8_t value)
Append a byte.
Helper class to estimate size of TLV encoding Interface of this class (mostly) matches interface of E...
size_t appendVarNumber(uint64_t varNumber)
Prepend VarNumber varNumber of NDN TLV encoding.
size_t prependNonNegativeInteger(uint64_t integer)
Prepend non-negative integer integer of NDN TLV encoding.