esp8266ndn
NDN Arduino library for ESP8266 and more
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
ndnph::ScopedEncoder Class Reference

Encoder that auto-discards upon destruction. More...

#include <encoder.hpp>

Inherits ndnph::Encoder.

Public Member Functions

 ~ScopedEncoder ()
 
 Encoder (uint8_t *buf, size_t capacity)
 Create over given buffer. More...
 
 Encoder (Region &region)
 Create over remaining space in a Region. More...
 
- Public Member Functions inherited from ndnph::Encoder
 Encoder (uint8_t *buf, size_t capacity)
 Create over given buffer. More...
 
 Encoder (Region &region)
 Create over remaining space in a Region. More...
 
 operator bool () const
 Return true if no errors were encountered, such as running out of space. More...
 
const uint8_t * begin () const
 Get output begin. More...
 
const uint8_t * end () const
 Get output end. More...
 
size_t size () const
 Get output size. More...
 
size_t availableHeadroom () const
 Get available headroom. More...
 
void trim () const
 Release unused space to the Region. More...
 
void discard ()
 Release all space to the Region. More...
 
void resetFront (uint8_t *pos)
 Reset front to given position. More...
 
uint8_t * prependRoom (size_t size)
 Make room to prepend an object. More...
 
bool prependTypeLength (uint32_t type, size_t length)
 Prepend TLV-TYPE and TLV-LENGTH. More...
 
template<typename First , typename... Arg>
bool prepend (const First &first, const Arg &... arg)
 Prepend a sequence of values. More...
 
template<typename... Arg>
bool prependTlv (uint32_t type, OmitEmptyTag omitEmpty, const Arg &... arg)
 Prepend TLV, measuring TLV-LENGTH automatically. More...
 
template<typename First , typename... Arg>
std::enable_if<!std::is_same< First, OmitEmptyTag >::value, bool >::type prependTlv (uint32_t type, const First &first, const Arg &... arg)
 Prepend TLV, measuring TLV-LENGTH automatically. More...
 
bool prependTlv (uint32_t type)
 Prepend TLV with zero TLV-LENGTH. More...
 
void setError ()
 Indicate an error has occurred. More...
 

Additional Inherited Members

- Public Types inherited from ndnph::Encoder
enum  OmitEmptyTag { NoOmitEmpty = 0 , OmitEmpty = 1 }
 

Detailed Description

Encoder that auto-discards upon destruction.

Constructor & Destructor Documentation

◆ ~ScopedEncoder()

ndnph::ScopedEncoder::~ScopedEncoder ( )
inline

Member Function Documentation

◆ Encoder() [1/2]

ndnph::Encoder::Encoder
inlineexplicit

Create over remaining space in a Region.

After encoding, unused space can be released with trim().

◆ Encoder() [2/2]

ndnph::Encoder::Encoder
inlineexplicit

Create over given buffer.


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