pabigot  0.1.1
C++ support classes
Public Member Functions | Friends
pabigot::ble::gap::adv_data::store_helper Class Reference

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
 

Detailed Description

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().


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