ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::json::JsonArena< N > Class Template Referencefinal

Bump allocator over a fixed buffer for a document built and serialized in one scope. More...

#include <json_util.h>

Inheritance diagram for esphome::json::JsonArena< N >:

Public Member Functions

 JsonArena (ArduinoJson::Allocator *fallback=heap_json_allocator())
 
 JsonArena (const JsonArena &)=delete
 
JsonArena & operator= (const JsonArena &)=delete
 
void * allocate (size_t size) override
 
void deallocate (void *ptr) override
 
void * reallocate (void *ptr, size_t new_size) override
 
size_t used () const
 Bytes of the buffer handed out so far.
 

Detailed Description

template<size_t N>
class esphome::json::JsonArena< N >

Bump allocator over a fixed buffer for a document built and serialized in one scope.

What the buffer cannot hold goes to the heap allocator; nothing is freed until the arena goes away.

Definition at line 194 of file json_util.h.

Constructor & Destructor Documentation

◆ JsonArena() [1/2]

template<size_t N>
esphome::json::JsonArena< N >::JsonArena ( ArduinoJson::Allocator * fallback = heap_json_allocator())
inlineexplicit

Definition at line 197 of file json_util.h.

◆ JsonArena() [2/2]

template<size_t N>
esphome::json::JsonArena< N >::JsonArena ( const JsonArena< N > & )
delete

Member Function Documentation

◆ allocate()

template<size_t N>
void * esphome::json::JsonArena< N >::allocate ( size_t size)
inlineoverride

Definition at line 202 of file json_util.h.

◆ deallocate()

template<size_t N>
void esphome::json::JsonArena< N >::deallocate ( void * ptr)
inlineoverride

Definition at line 214 of file json_util.h.

◆ operator=()

template<size_t N>
JsonArena & esphome::json::JsonArena< N >::operator= ( const JsonArena< N > & )
delete

◆ reallocate()

template<size_t N>
void * esphome::json::JsonArena< N >::reallocate ( void * ptr,
size_t new_size )
inlineoverride

Definition at line 219 of file json_util.h.

◆ used()

template<size_t N>
size_t esphome::json::JsonArena< N >::used ( ) const
inline

Bytes of the buffer handed out so far.

Definition at line 243 of file json_util.h.


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