jaulib v1.3.6
Jau Support Library (C++, Java, ..)
Loading...
Searching...
No Matches
jau::math::util::SyncBuffer Class Referenceabstract

Convenient tuple of a sync_action_t and data buffer. More...

#include <syncbuffer.hpp>

Inheritance diagram for jau::math::util::SyncBuffer:
Collaboration diagram for jau::math::util::SyncBuffer:

Public Member Functions

virtual ~SyncBuffer () noexcept=default
 
virtual sync_action_taction () noexcept=0
 Return the defined sync_action_t.
 
size_t byteSize () const noexcept
 
virtual const void * data () const noexcept=0
 Return the underlying data buffer as bytes.
 
const float32_tdata_f32 () const
 Return the underlying data buffer as float32_t if valueSignature() matches, otherwise throw.
 
const int32_t * data_i32 () const
 Return the underlying data buffer as int32_t if valueSignature() matches, otherwise throw.
 
const int8_t * data_i8 () const
 Return the underlying data buffer as int8_t if valueSignature() matches, otherwise throw.
 
virtual size_t elementCount () const noexcept=0
 Returns element count, total byte size = elementSize() * elementCount()
 
virtual size_t elementSize () const noexcept=0
 Returns element size in bytes.
 
SyncBuffersync () noexcept
 Synchronizes the underlying data before usage.
 
std::string toString () const
 
virtual const jau::type_infovalueSignature () const noexcept=0
 Returns type signature of implementing class's stored value type.
 

Detailed Description

Convenient tuple of a sync_action_t and data buffer.

sync_action_t is used to update the data buffer in case it is derived or must be otherwise transported, defined by the data provider.

Definition at line 57 of file syncbuffer.hpp.

Constructor & Destructor Documentation

◆ ~SyncBuffer()

virtual jau::math::util::SyncBuffer::~SyncBuffer ( )
virtualdefaultnoexcept

Member Function Documentation

◆ valueSignature()

◆ action()

virtual sync_action_t & jau::math::util::SyncBuffer::action ( )
pure virtualnoexcept

Return the defined sync_action_t.

Here is the caller graph for this function:

◆ data()

◆ elementSize()

◆ elementCount()

◆ byteSize()

size_t jau::math::util::SyncBuffer::byteSize ( ) const
inlinenoexcept

Definition at line 76 of file syncbuffer.hpp.

Here is the caller graph for this function:

◆ sync()

SyncBuffer & jau::math::util::SyncBuffer::sync ( )
inlinenoexcept

Synchronizes the underlying data before usage.

Convenient shortcut for action()() plus chaining.

Definition at line 84 of file syncbuffer.hpp.

◆ toString()

std::string jau::math::util::SyncBuffer::toString ( ) const
inline

Definition at line 86 of file syncbuffer.hpp.

◆ data_i8()

const int8_t * jau::math::util::SyncBuffer::data_i8 ( ) const
inline

Return the underlying data buffer as int8_t if valueSignature() matches, otherwise throw.

Definition at line 93 of file syncbuffer.hpp.

◆ data_i32()

const int32_t * jau::math::util::SyncBuffer::data_i32 ( ) const
inline

Return the underlying data buffer as int32_t if valueSignature() matches, otherwise throw.

Definition at line 102 of file syncbuffer.hpp.

◆ data_f32()

const float32_t * jau::math::util::SyncBuffer::data_f32 ( ) const
inline

Return the underlying data buffer as float32_t if valueSignature() matches, otherwise throw.

Definition at line 111 of file syncbuffer.hpp.


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