DynExp
Highly flexible laboratory automation for dynamically changing experiments.
Util::BlobDataType Class Reference

Data type which manages a binary large object. The reserved memory is freed upon destruction. More...

Public Types

using DataType = unsigned char[]
 Type of the buffer's data. More...
 

Public Member Functions

 BlobDataType ()=default
 Constructs an empty object. More...
 
 BlobDataType (const BlobDataType &Other)
 Constructs an object copying data from Other. More...
 
 BlobDataType (BlobDataType &&Other) noexcept
 Constructs an object moving from Other. Other is empty afterwards. More...
 
BlobDataTypeoperator= (const BlobDataType &Other)
 Copy-assigns data from Other. More...
 
BlobDataTypeoperator= (BlobDataType &&Other) noexcept
 Move-assigns data from Other. Other is empty afterwards. More...
 
void Reserve (size_t Size)
 Reserves Size bytes of memory freeing any previously reserved memory. More...
 
void Assign (size_t Size, const DataType Data)
 Copies Size bytes from Data to the buffer freeing any previously reserved memory. More...
 
void Reset ()
 Frees any reserved memory. More...
 
DataPtrType::element_type * Release () noexcept
 Releases ownership of the stored buffer returning a pointer to it and leaving this instance empty. More...
 
auto GetPtr () noexcept
 Returns a pointer to the stored buffer. More...
 
auto Size () const noexcept
 Returns the size of the stored data in bytes. More...
 

Private Types

using DataPtrType = std::unique_ptr< DataType >
 Type of the underlying smart pointer managing the buffer. More...
 

Private Attributes

DataPtrType DataPtr
 Pointer to the buffer. More...
 
size_t DataSize = 0
 Size of the stored data in bytes. More...
 

Detailed Description

Data type which manages a binary large object. The reserved memory is freed upon destruction.

Definition at line 516 of file Util.h.

Member Typedef Documentation

◆ DataPtrType

using Util::BlobDataType::DataPtrType = std::unique_ptr<DataType>
private

Type of the underlying smart pointer managing the buffer.

Definition at line 522 of file Util.h.

◆ DataType

using Util::BlobDataType::DataType = unsigned char[]

Type of the buffer's data.

Definition at line 519 of file Util.h.

Constructor & Destructor Documentation

◆ BlobDataType() [1/3]

Util::BlobDataType::BlobDataType ( )
default

Constructs an empty object.

◆ BlobDataType() [2/3]

Util::BlobDataType::BlobDataType ( const BlobDataType Other)

Constructs an object copying data from Other.

Definition at line 85 of file Util.cpp.

◆ BlobDataType() [3/3]

Util::BlobDataType::BlobDataType ( BlobDataType &&  Other)
noexcept

Constructs an object moving from Other. Other is empty afterwards.

Definition at line 95 of file Util.cpp.

Member Function Documentation

◆ Assign()

void Util::BlobDataType::Assign ( size_t  Size,
const DataType  Data 
)

Copies Size bytes from Data to the buffer freeing any previously reserved memory.

Definition at line 131 of file Util.cpp.

◆ GetPtr()

auto Util::BlobDataType::GetPtr ( )
inlinenoexcept

Returns a pointer to the stored buffer.

Definition at line 536 of file Util.h.

◆ operator=() [1/2]

BlobDataType & Util::BlobDataType::operator= ( BlobDataType &&  Other)
noexcept

Move-assigns data from Other. Other is empty afterwards.

Definition at line 109 of file Util.cpp.

◆ operator=() [2/2]

BlobDataType & Util::BlobDataType::operator= ( const BlobDataType Other)

Copy-assigns data from Other.

Definition at line 101 of file Util.cpp.

◆ Release()

BlobDataType::DataPtrType::element_type * Util::BlobDataType::Release ( )
noexcept

Releases ownership of the stored buffer returning a pointer to it and leaving this instance empty.

Definition at line 143 of file Util.cpp.

◆ Reserve()

void Util::BlobDataType::Reserve ( size_t  Size)

Reserves Size bytes of memory freeing any previously reserved memory.

Definition at line 118 of file Util.cpp.

◆ Reset()

void Util::BlobDataType::Reset ( )

Frees any reserved memory.

Definition at line 137 of file Util.cpp.

◆ Size()

auto Util::BlobDataType::Size ( ) const
inlinenoexcept

Returns the size of the stored data in bytes.

Definition at line 537 of file Util.h.

Member Data Documentation

◆ DataPtr

DataPtrType Util::BlobDataType::DataPtr
private

Pointer to the buffer.

Definition at line 540 of file Util.h.

◆ DataSize

size_t Util::BlobDataType::DataSize = 0
private

Size of the stored data in bytes.

Definition at line 541 of file Util.h.


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