All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ndn::EncodingImpl< encoding::Buffer > Class Template Reference

Class representing wire element of the NDN packet. More...

#include <encoding-buffer.hpp>

Public Member Functions

 EncodingImpl (size_t totalReserve=8800, size_t reserveFromBack=400)
 Constructor to create a EncodingImpl with specified reserved sizes. More...
 
 EncodingImpl (const Block &block)
 Create EncodingBlock from existing block. More...
 
size_t size () const
 
size_t capacity () const
 
uint8_t * buf ()
 
const uint8_t * buf () const
 
Block block (bool verifyLength=true) const
 Create Block from the underlying EncodingBuffer. More...
 
void resize (size_t size, bool addInFront)
 
Buffer::iterator begin ()
 
Buffer::iterator end ()
 
Buffer::const_iterator begin () const
 
Buffer::const_iterator end () const
 
size_t prependByte (uint8_t value)
 
size_t prependByteArray (const uint8_t *array, size_t length)
 
size_t prependNonNegativeInteger (uint64_t varNumber)
 
size_t prependVarNumber (uint64_t varNumber)
 
size_t appendByte (uint8_t value)
 
size_t appendByteArray (const uint8_t *array, size_t length)
 
size_t appendNonNegativeInteger (uint64_t varNumber)
 
size_t appendVarNumber (uint64_t varNumber)
 

Friends

class Block
 

Detailed Description

template<>
class ndn::EncodingImpl< encoding::Buffer >

Class representing wire element of the NDN packet.

Definition at line 38 of file encoding-buffer.hpp.

Constructor & Destructor Documentation

ndn::EncodingImpl< encoding::Buffer >::EncodingImpl ( size_t  totalReserve = 8800,
size_t  reserveFromBack = 400 
)
inline

Constructor to create a EncodingImpl with specified reserved sizes.

The caller should make sure that that reserveFromBack does not exceed totalReserve, otherwise behavior is undefined.

Definition at line 47 of file encoding-buffer.hpp.

ndn::EncodingImpl< encoding::Buffer >::EncodingImpl ( const Block block)
inlineexplicit

Create EncodingBlock from existing block.

This is a dangerous constructor and should be used with caution. It will modify contents of the buffer that is used by block and may impact data in other blocks.

The primary purpose for this method is to be used to extend Block after sign operation.

Definition at line 65 of file encoding-buffer.hpp.

Member Function Documentation

size_t ndn::EncodingImpl< encoding::Buffer >::appendByte ( uint8_t  value)
inline

Definition at line 411 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::appendByteArray ( const uint8_t *  array,
size_t  length 
)
inline

Definition at line 428 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::appendNonNegativeInteger ( uint64_t  varNumber)
inline

Definition at line 445 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::appendVarNumber ( uint64_t  varNumber)
inline

Definition at line 471 of file encoding-buffer.hpp.

Buffer::iterator ndn::EncodingImpl< encoding::Buffer >::begin ( )
inline

Definition at line 263 of file encoding-buffer.hpp.

Buffer::const_iterator ndn::EncodingImpl< encoding::Buffer >::begin ( ) const
inline

Definition at line 275 of file encoding-buffer.hpp.

Block ndn::EncodingImpl< encoding::Buffer >::block ( bool  verifyLength = true) const
inline

Create Block from the underlying EncodingBuffer.

Parameters
verifyLengthIf this parameter set to true, Block's constructor will be requested to verify consistency of the encoded length in the Block, otherwise ignored

Definition at line 224 of file encoding-buffer.hpp.

uint8_t * ndn::EncodingImpl< encoding::Buffer >::buf ( )
inline

Definition at line 212 of file encoding-buffer.hpp.

const uint8_t * ndn::EncodingImpl< encoding::Buffer >::buf ( ) const
inline

Definition at line 218 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::capacity ( ) const
inline

Definition at line 206 of file encoding-buffer.hpp.

Buffer::iterator ndn::EncodingImpl< encoding::Buffer >::end ( )
inline

Definition at line 269 of file encoding-buffer.hpp.

Buffer::const_iterator ndn::EncodingImpl< encoding::Buffer >::end ( ) const
inline

Definition at line 281 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::prependByte ( uint8_t  value)
inline

Definition at line 292 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::prependByteArray ( const uint8_t *  array,
size_t  length 
)
inline

Definition at line 309 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::prependNonNegativeInteger ( uint64_t  varNumber)
inline

Definition at line 326 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::prependVarNumber ( uint64_t  varNumber)
inline

Definition at line 363 of file encoding-buffer.hpp.

void ndn::EncodingImpl< encoding::Buffer >::resize ( size_t  size,
bool  addInFront 
)
inline

Definition at line 232 of file encoding-buffer.hpp.

size_t ndn::EncodingImpl< encoding::Buffer >::size ( ) const
inline

Definition at line 200 of file encoding-buffer.hpp.

Friends And Related Function Documentation

friend class Block
friend

Definition at line 153 of file encoding-buffer.hpp.