10Duke Enterprise C++ Client
|
#include <FixedSizeBinaryData.h>
Utility class for fixed size binary data.
Maintains memory for the contained memory area.
Public Member Functions | |
FixedSizeBinaryData (std::size_t length) | |
Constructs new instance by allocating memory of length bytes. | |
FixedSizeBinaryData (std::unique_ptr< unsigned char[]> data, std::size_t length) | |
Constructs new instance by taking ownership of given data. | |
FixedSizeBinaryData (const FixedSizeBinaryData ©) | |
Copy constructs new instance. | |
FixedSizeBinaryData (const BinaryData ©) | |
Copy constructs new instance. | |
~FixedSizeBinaryData () override | |
Destructs the instance, frees contained data. | |
unsigned char * | getData () const override |
Returns pointer to the data. | |
std::size_t | getLength () const override |
Returns length of the data. | |
Static Public Member Functions | |
static std::unique_ptr< unsigned char[]> | allocateData (size_t length) |
Allocates memory for length bytes. | |
|
explicit |
Constructs new instance by allocating memory of length
bytes.
length | num bytes to allocate. |
tenduke::utl::FixedSizeBinaryData::FixedSizeBinaryData | ( | std::unique_ptr< unsigned char[]> | data, |
std::size_t | length | ||
) |
Constructs new instance by taking ownership of given data.
data | the data to wrap |
length | size of the data |
tenduke::utl::FixedSizeBinaryData::FixedSizeBinaryData | ( | const FixedSizeBinaryData & | copy | ) |
Copy constructs new instance.
copy | - |
|
explicit |
Copy constructs new instance.
copy | - |
|
static |
Allocates memory for length
bytes.
length | - |
|
overridevirtual |
Returns pointer to the data.
Do not free or deallocate this!
Implements tenduke::utl::BinaryData.
|
overridevirtual |