class AnyArena
Defined at line 33 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/arena.h
The interface for any arena which may be used to allocate buffers and FIDL
domain objects.
The desired style of using |AnyArena| is to pass a reference
when a function does not care about the specific initial size of the arena:
// This function constructs a |Bar| object using the arena.
// The returned |Bar| will outlive the scope of the |GetBar| function,
// and is only destroyed when the supplied arena goes away.
fidl::ObjectView
<Bar
> GetBar(fidl::AnyArena
&
arena);
Public Methods
template <typename T, typename... Args>
T * Allocate (Args &&... args)
Allocates and constructs an instance of T. Used by |fidl::ObjectView|.
If T can be directly constructed from |Args|, then those args are
forwarded. Otherwise, this arena will be passed as the first parameter,
followed by |args|. The latter is useful for e.g. object view of a
string view, where we'd like to reuse the same arena for the string.
Defined at line 42 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/arena.h
template <typename T>
T * AllocateVector (size_t count)
Allocates and default constructs a vector of T. Used by fidl::VectorView
and StringView. All the |count| vector elements are constructed.
Defined at line 57 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/arena.h
Protected Methods
uint8_t * Allocate (size_t item_size, size_t count, void (*)(uint8_t *, size_t) destructor_function)
Override this method to implement the allocation.
|Allocate| allocates the requested elements and eventually records the
destructor to call during the arena destruction if |destructor_function| is
not null. The allocated data is not initialized (it will be initialized by
the caller).
void AnyArena ()
Defined at line 64 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/arena.h
void ~AnyArena ()
Defined at line 65 of file ../../sdk/lib/fidl/cpp/wire/include/lib/fidl/cpp/wire/arena.h
Friends
inline_any AnyArena (AnyArena & arena)