Banuba SDK
Loading...
Searching...
No Matches
bnb::data_t Struct Reference

Public Types

using type = uint8_t[]
 
using pointer = uint8_t*
 
using uptr = std::unique_ptr<type, std::function<void(pointer)>>
 

Public Member Functions

void reserve (size_t reserve_size)
 
 data_t (uptr d, size_t s)
 
 data_t (data_t &&)=default
 
data_toperator= (data_t &&)=default
 

Static Public Member Functions

static data_t create_non_owning (std::shared_ptr< uint8_t > datum, size_t size)
 
static data_t create_non_owning (uint8_t *datum, size_t size)
 

Public Attributes

uptr data
 
size_t size
 

Detailed Description

Definition at line 156 of file base_types.hpp.

Member Typedef Documentation

◆ pointer

using bnb::data_t::pointer = uint8_t*

Definition at line 159 of file base_types.hpp.

◆ type

using bnb::data_t::type = uint8_t[]

Definition at line 158 of file base_types.hpp.

◆ uptr

using bnb::data_t::uptr = std::unique_ptr<type, std::function<void(pointer)>>

Definition at line 160 of file base_types.hpp.

Constructor & Destructor Documentation

◆ data_t()

bnb::data_t::data_t ( uptr d,
size_t s )
inline

Definition at line 187 of file base_types.hpp.

188 : data(std::move(d))
189 , size(s)
190 {
191 }

Member Function Documentation

◆ create_non_owning() [1/2]

static data_t bnb::data_t::create_non_owning ( std::shared_ptr< uint8_t > datum,
size_t size )
inlinestatic

Definition at line 164 of file base_types.hpp.

165 {
166 return data_t{
167 uptr(datum.get(), [](pointer) { /* don't release */ }),
168 size};
169 }

◆ create_non_owning() [2/2]

static data_t bnb::data_t::create_non_owning ( uint8_t * datum,
size_t size )
inlinestatic

Definition at line 171 of file base_types.hpp.

172 {
173 return data_t{
174 uptr(datum, [](pointer) {}),
175 size};
176 }

◆ reserve()

void bnb::data_t::reserve ( size_t reserve_size)
inline

Definition at line 178 of file base_types.hpp.

179 {
180 if (size < reserve_size) {
181 data = std::make_unique<type>(reserve_size);
182 size = reserve_size;
183 }
184 }

Member Data Documentation

◆ data

uptr bnb::data_t::data

Definition at line 161 of file base_types.hpp.

◆ size

size_t bnb::data_t::size

Definition at line 162 of file base_types.hpp.


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