Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Public Member Functions | List of all members
direct_bt::POctets Class Reference

Persistent octet data, i.e. More...

#include <OctetTypes.hpp>

Inheritance diagram for direct_bt::POctets:
Collaboration diagram for direct_bt::POctets:

Public Member Functions

constexpr jau::nsize_t getCapacity () const noexcept
 Returns the memory capacity, never zero, greater or equal getSize(). More...
 
 POctets ()
 Intentional zero sized POctets instance. More...
 
 POctets (const uint8_t *_source, const jau::nsize_t size_)
 Takes ownership (malloc and copy, free) . More...
 
 POctets (const jau::nsize_t _capacity, const jau::nsize_t size_)
 New buffer (malloc, free) More...
 
 POctets (const jau::nsize_t size)
 New buffer (malloc, free) More...
 
 POctets (const POctets &_source)
 
 POctets (POctets &&o) noexcept
 
POctetsoperator= (const POctets &_source)
 
POctetsoperator= (POctets &&o) noexcept
 
virtual ~POctets () noexcept override
 
 POctets (const TROOctets &_source)
 Makes a persistent POctets by copying the data from TROOctets. More...
 
POctetsoperator= (const TROOctets &_source)
 
 POctets (const TOctetSlice &_source)
 Makes a persistent POctets by copying the data from TOctetSlice. More...
 
POctetsoperator= (const TOctetSlice &_source)
 
POctetsresize (const jau::nsize_t newSize, const jau::nsize_t newCapacity)
 
POctetsresize (const jau::nsize_t newSize)
 
POctetsrecapacity (const jau::nsize_t newCapacity)
 
POctetsoperator+= (const TROOctets &b)
 
POctetsoperator+= (const TOctetSlice &b)
 
std::string toString () const
 
- Public Member Functions inherited from direct_bt::TOctets
 TOctets (uint8_t *source, const jau::nsize_t len)
 Transient passthrough r/w memory, w/o ownership . More...
 
 TOctets (const TOctets &o) noexcept=default
 
 TOctets (TOctets &&o) noexcept=default
 
TOctetsoperator= (const TOctets &o) noexcept=default
 
TOctetsoperator= (TOctets &&o) noexcept=default
 
virtual ~TOctets () noexcept override
 
void put_int8 (const jau::nsize_t i, const int8_t v)
 
constexpr void put_int8_nc (const jau::nsize_t i, const int8_t v) noexcept
 
void put_uint8 (const jau::nsize_t i, const uint8_t v)
 
constexpr void put_uint8_nc (const jau::nsize_t i, const uint8_t v) noexcept
 
void put_uint16 (const jau::nsize_t i, const uint16_t v)
 
constexpr void put_uint16_nc (const jau::nsize_t i, const uint16_t v) noexcept
 
void put_uint32 (const jau::nsize_t i, const uint32_t v)
 
constexpr void put_uint32_nc (const jau::nsize_t i, const uint32_t v) noexcept
 
void put_eui48 (const jau::nsize_t i, const EUI48 &v)
 
void put_eui48_nc (const jau::nsize_t i, const EUI48 &v) noexcept
 
void put_uint64 (const jau::nsize_t i, const uint64_t &v)
 
constexpr void put_uint64_nc (const jau::nsize_t i, const uint64_t &v) noexcept
 
void put_uint128 (const jau::nsize_t i, const jau::uint128_t &v)
 
constexpr void put_uint128_nc (const jau::nsize_t i, const jau::uint128_t &v) noexcept
 
void put_uint192 (const jau::nsize_t i, const jau::uint192_t &v)
 
constexpr void put_uint192_nc (const jau::nsize_t i, const jau::uint192_t &v) noexcept
 
void put_uint256 (const jau::nsize_t i, const jau::uint256_t &v)
 
constexpr void put_uint256_nc (const jau::nsize_t i, const jau::uint256_t &v) noexcept
 
void put_octets (const jau::nsize_t i, const TROOctets &v)
 
void put_octets_nc (const jau::nsize_t i, const TROOctets &v) noexcept
 
void put_bytes (const jau::nsize_t i, const uint8_t *source, const jau::nsize_t byte_count)
 
void put_bytes_nc (const jau::nsize_t i, const uint8_t *source, const jau::nsize_t byte_count) noexcept
 
void put_string (const jau::nsize_t i, const std::string &v, const jau::nsize_t max_len, const bool includeEOS)
 
void put_string_nc (const jau::nsize_t i, const std::string &v, const jau::nsize_t max_len, const bool includeEOS) noexcept
 
void put_uuid (const jau::nsize_t i, const uuid_t &v)
 
void put_uuid_nc (const jau::nsize_t i, const uuid_t &v) noexcept
 
uint8_t * get_wptr () noexcept
 
uint8_t * get_wptr (const jau::nsize_t i)
 
uint8_t * get_wptr_nc (const jau::nsize_t i) noexcept
 
std::string toString () const noexcept
 
- Public Member Functions inherited from direct_bt::TROOctets
 TROOctets (const uint8_t *source, const jau::nsize_t len)
 Transient passthrough read-only memory, w/o ownership . More...
 
 TROOctets (const TROOctets &o) noexcept=default
 
 TROOctets (TROOctets &&o) noexcept=default
 
TROOctetsoperator= (const TROOctets &o) noexcept=default
 
TROOctetsoperator= (TROOctets &&o) noexcept=default
 
virtual ~TROOctets () noexcept
 
void check_range (const jau::nsize_t i, const jau::nsize_t count, const char *file, int line) const
 
constexpr bool is_range_valid (const jau::nsize_t i, const jau::nsize_t count) const noexcept
 
constexpr jau::nsize_t getSize () const noexcept
 Returns the used memory size for read and write operations, may be zero. More...
 
uint8_t get_uint8 (const jau::nsize_t i) const
 
constexpr uint8_t get_uint8_nc (const jau::nsize_t i) const noexcept
 
int8_t get_int8 (const jau::nsize_t i) const
 
constexpr int8_t get_int8_nc (const jau::nsize_t i) const noexcept
 
uint16_t get_uint16 (const jau::nsize_t i) const
 
constexpr uint16_t get_uint16_nc (const jau::nsize_t i) const noexcept
 
uint32_t get_uint32 (const jau::nsize_t i) const
 
constexpr uint32_t get_uint32_nc (const jau::nsize_t i) const noexcept
 
EUI48 get_eui48 (const jau::nsize_t i) const
 
EUI48 get_eui48_nc (const jau::nsize_t i) const noexcept
 
uint64_t get_uint64 (const jau::nsize_t i) const
 
constexpr uint64_t get_uint64_nc (const jau::nsize_t i) const noexcept
 
jau::uint128_t get_uint128 (const jau::nsize_t i) const
 
constexpr jau::uint128_t get_uint128_nc (const jau::nsize_t i) const noexcept
 
jau::uint192_t get_uint192 (const jau::nsize_t i) const
 
constexpr jau::uint192_t get_uint192_nc (const jau::nsize_t i) const noexcept
 
jau::uint256_t get_uint256 (const jau::nsize_t i) const
 
constexpr jau::uint256_t get_uint256_nc (const jau::nsize_t i) const noexcept
 
std::string get_string (const jau::nsize_t i) const
 Assumes a null terminated string. More...
 
constexpr_cxx20 std::string get_string_nc (const jau::nsize_t i) const noexcept
 Assumes a null terminated string. More...
 
std::string get_string (const jau::nsize_t i, const jau::nsize_t length) const
 Assumes a string with defined length, not necessarily null terminated. More...
 
uuid16_t get_uuid16 (const jau::nsize_t i) const
 
uuid16_t get_uuid16_nc (const jau::nsize_t i) const noexcept
 
uuid128_t get_uuid128 (const jau::nsize_t i) const
 
uuid128_t get_uuid128_nc (const jau::nsize_t i) const noexcept
 
std::unique_ptr< const uuid_tget_uuid (const jau::nsize_t i, const uuid_t::TypeSize tsize) const
 
constexpr uint8_t const * get_ptr () const noexcept
 
uint8_t const * get_ptr (const jau::nsize_t i) const
 
constexpr uint8_t const * get_ptr_nc (const jau::nsize_t i) const noexcept
 
bool operator== (const TROOctets &rhs) const noexcept
 
bool operator!= (const TROOctets &rhs) const noexcept
 
std::string toString () const noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from direct_bt::TROOctets
constexpr uint8_t * data () noexcept
 
void setData (uint8_t *d, jau::nsize_t s)
 
constexpr void setSize (jau::nsize_t s) noexcept
 
- Static Protected Member Functions inherited from direct_bt::TROOctets
static void checkPtr (uint8_t *d, jau::nsize_t s)
 

Detailed Description

Persistent octet data, i.e.

owned memory allocation.

GATT value (Vol 3, Part F 3.2.4)

Examples
dbt_scanner00.cpp, dbt_scanner01.cpp, and dbt_scanner10.cpp.

Definition at line 450 of file OctetTypes.hpp.

Constructor & Destructor Documentation

◆ POctets() [1/8]

direct_bt::POctets::POctets ( )
inline

Intentional zero sized POctets instance.

Definition at line 479 of file OctetTypes.hpp.

◆ POctets() [2/8]

direct_bt::POctets::POctets ( const uint8_t *  _source,
const jau::nsize_t  size_ 
)
inline

Takes ownership (malloc and copy, free) .

Definition at line 486 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ POctets() [3/8]

direct_bt::POctets::POctets ( const jau::nsize_t  _capacity,
const jau::nsize_t  size_ 
)
inline

New buffer (malloc, free)

Definition at line 495 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ POctets() [4/8]

direct_bt::POctets::POctets ( const jau::nsize_t  size)
inline

New buffer (malloc, free)

Definition at line 506 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ POctets() [5/8]

direct_bt::POctets::POctets ( const POctets _source)
inline

Definition at line 512 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ POctets() [6/8]

direct_bt::POctets::POctets ( POctets &&  o)
inlinenoexcept

Definition at line 520 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ ~POctets()

virtual direct_bt::POctets::~POctets ( )
inlineoverridevirtualnoexcept

Definition at line 554 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ POctets() [7/8]

direct_bt::POctets::POctets ( const TROOctets _source)
inline

Makes a persistent POctets by copying the data from TROOctets.

Definition at line 561 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ POctets() [8/8]

direct_bt::POctets::POctets ( const TOctetSlice _source)
inline

Makes a persistent POctets by copying the data from TOctetSlice.

Definition at line 582 of file OctetTypes.hpp.

Here is the call graph for this function:

Member Function Documentation

◆ getCapacity()

constexpr jau::nsize_t direct_bt::POctets::getCapacity ( ) const
inlineconstexprnoexcept

Returns the memory capacity, never zero, greater or equal getSize().

Definition at line 476 of file OctetTypes.hpp.

Here is the caller graph for this function:

◆ operator+=() [1/2]

POctets& direct_bt::POctets::operator+= ( const TOctetSlice b)
inline

Definition at line 654 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ operator+=() [2/2]

POctets& direct_bt::POctets::operator+= ( const TROOctets b)
inline

Definition at line 643 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ operator=() [1/4]

POctets& direct_bt::POctets::operator= ( const POctets _source)
inline

Definition at line 531 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ operator=() [2/4]

POctets& direct_bt::POctets::operator= ( const TOctetSlice _source)
inline

Definition at line 590 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ operator=() [3/4]

POctets& direct_bt::POctets::operator= ( const TROOctets _source)
inline

Definition at line 569 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ operator=() [4/4]

POctets& direct_bt::POctets::operator= ( POctets &&  o)
inlinenoexcept

Definition at line 543 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ recapacity()

POctets& direct_bt::POctets::recapacity ( const jau::nsize_t  newCapacity)
inline

Definition at line 625 of file OctetTypes.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resize() [1/2]

POctets& direct_bt::POctets::resize ( const jau::nsize_t  newSize)
inline

Definition at line 617 of file OctetTypes.hpp.

Here is the call graph for this function:

◆ resize() [2/2]

POctets& direct_bt::POctets::resize ( const jau::nsize_t  newSize,
const jau::nsize_t  newCapacity 
)
inline

Definition at line 599 of file OctetTypes.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

std::string direct_bt::POctets::toString ( ) const
inline

Definition at line 666 of file OctetTypes.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

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