ObjectBox C and C++ API  4.0.3
obx::BytesLazy Class Reference

Bytes, which must be resolved "lazily" via get() and released via this object (destructor). Unlike void* style bytes, this may represent allocated resources and/or bytes that are only produced on demand. More...

#include <objectbox.hpp>

Public Member Functions

 BytesLazy ()
 
 BytesLazy (OBX_bytes_lazy *cBytes)
 
 BytesLazy (BytesLazy &&src) noexcept
 
 BytesLazy (const BytesLazy &src)=delete
 No copying allowed: OBX_bytes_lazy needs a single owner (no method to "clone" it). More...
 
 ~BytesLazy ()
 
bool hasBytes ()
 
bool isNull ()
 
void swap (BytesLazy &other)
 
void clear ()
 Clears any bytes resources. More...
 
void get (const void *&outBytes, size_t &outSize) const
 Gets the bytes and its size using the given "out" references. More...
 
size_t size ()
 Note that this will potentially resolve actual bytes just like get(). Also, it would be more efficient to only call get() to get everything in a single call. More...
 

Detailed Description

Bytes, which must be resolved "lazily" via get() and released via this object (destructor). Unlike void* style bytes, this may represent allocated resources and/or bytes that are only produced on demand.

Constructor & Destructor Documentation

◆ BytesLazy() [1/4]

obx::BytesLazy::BytesLazy ( )
inline

◆ BytesLazy() [2/4]

obx::BytesLazy::BytesLazy ( OBX_bytes_lazy cBytes)
inlineexplicit

◆ BytesLazy() [3/4]

obx::BytesLazy::BytesLazy ( BytesLazy &&  src)
inlinenoexcept

◆ BytesLazy() [4/4]

obx::BytesLazy::BytesLazy ( const BytesLazy src)
delete

No copying allowed: OBX_bytes_lazy needs a single owner (no method to "clone" it).

◆ ~BytesLazy()

obx::BytesLazy::~BytesLazy ( )
inline

Member Function Documentation

◆ clear()

void obx::BytesLazy::clear ( )
inline

Clears any bytes resources.

◆ get()

void obx::BytesLazy::get ( const void *&  outBytes,
size_t &  outSize 
) const
inline

Gets the bytes and its size using the given "out" references.

◆ hasBytes()

bool obx::BytesLazy::hasBytes ( )
inline
Returns
true if it holds actual bytes resources (e.g. not default-constructed and not clear()ed yet).

◆ isNull()

bool obx::BytesLazy::isNull ( )
inline
Returns
true if it does not hold any bytes resources (e.g. default-constructed or already clear()ed).

◆ size()

size_t obx::BytesLazy::size ( )
inline

Note that this will potentially resolve actual bytes just like get(). Also, it would be more efficient to only call get() to get everything in a single call.

◆ swap()

void obx::BytesLazy::swap ( BytesLazy other)
inline