pabigot
0.1.1
C++ support classes
|
RAII helper to avoid overruns and to back-fill lengths. More...
#include </mnt/devel/pabigot-cxx/include/pabigot/ble/gap.hpp>
Public Member Functions | |
operator bool () const noexcept | |
true iff the requested space was available on construction. | |
~store_helper () | |
Destructor updates length field if content was added since construction. | |
Friends | |
class | adv_data |
RAII helper to avoid overruns and to back-fill lengths.
The constructor checks whether the expected length would exceed the available space, and if so marks the owning buffer as invalid. Otherwise it stores the expected length and type tag.
The destructor verifies that the owning buffer remains valid, and if content was added after the constructor updates the length octet to record the space used.
See usage at start_store().