#include <MIDI_Interfaces/BLEMIDI/BLEAPI.hpp>
Callable that returns the next chunk of data from a BLE packet when called.
Uses type erasure with a static buffer (no dynamic memory allocations).
Definition at line 66 of file BLEAPI.hpp.
Classes | |
struct | Impl |
Specific class that implements the type-erased interface, wrapping the type T . More... | |
Public Member Functions | |
BLEDataView | operator() () |
Get the next chunk of data from the BLE packet. | |
void | clear () |
Release the resources of the underlying data generator. | |
operator bool () const | |
Check if this wrapper contains an underlying data generator. | |
BLEDataGenerator ()=default | |
Create an empty BLEDataGenerator. | |
template<class T , class... Args> | |
BLEDataGenerator (compat::in_place_type_t< T >, Args &&...args) | |
Store a callable of type T and initialize it by args . | |
template<class T > | |
BLEDataGenerator (compat::in_place_t, T &&t) | |
Store a callable of type T (with cv qualifiers and references removed) and initialize it by forwarding t . | |
BLEDataGenerator (const BLEDataGenerator &)=delete | |
BLEDataGenerator & | operator= (const BLEDataGenerator &)=delete |
BLEDataGenerator (BLEDataGenerator &&other) noexcept | |
BLEDataGenerator & | operator= (BLEDataGenerator &&other) noexcept |
~BLEDataGenerator () | |
Private Types | |
using | buffer_align_t = max_align_t |
Alignment of the buffer to allocate the underlying data generator. | |
Private Attributes | |
compat::byte | storage [capacity] |
Buffer used for allocation of the underlying data generator. | |
Iface * | instance = nullptr |
Static Private Attributes | |
static constexpr size_t | capacity = 4 * sizeof(void *) - sizeof(Iface *) |
Size of the buffer to allocate the underlying data generator. | |
|
private |
Alignment of the buffer to allocate the underlying data generator.
Definition at line 102 of file BLEAPI.hpp.
|
default |
Create an empty BLEDataGenerator.
BLEDataGenerator | ( | compat::in_place_type_t< T > | , |
Args &&... | args ) |
Store a callable of type T
and initialize it by args
.
BLEDataGenerator | ( | compat::in_place_t | , |
T && | t ) |
Store a callable of type T
(with cv qualifiers and references removed) and initialize it by forwarding t
.
|
delete |
|
noexcept |
|
inline |
Definition at line 92 of file BLEAPI.hpp.
BLEDataView operator() | ( | ) |
Get the next chunk of data from the BLE packet.
Returns a chunk of size zero to indicate completion.
void clear | ( | ) |
Release the resources of the underlying data generator.
|
inlineexplicit |
Check if this wrapper contains an underlying data generator.
Definition at line 77 of file BLEAPI.hpp.
|
delete |
|
noexcept |
|
staticconstexprprivate |
Size of the buffer to allocate the underlying data generator.
Definition at line 104 of file BLEAPI.hpp.
|
private |
Buffer used for allocation of the underlying data generator.
Definition at line 106 of file BLEAPI.hpp.
|
private |
Definition at line 108 of file BLEAPI.hpp.