Class that represents blob primitive type. More...
#include <SPL/Runtime/Type/Blob.h>
Class that represents blob primitive type.
◆ blob() [1/4]
◆ blob() [2/4]
SPL::blob::blob |
( |
unsigned char const * |
data, |
|
|
uint64_t |
size |
|
) |
|
|
Constructor. The data is copied from the memory block passed in as a parameter, into the internal buffer hold by the blob
- Parameters
-
data |
pointer to the memory block to be used for copying data |
size |
size of the memory block to be used for copying data |
◆ blob() [3/4]
SPL::blob::blob |
( |
const List & |
data |
) |
|
Constructor. The data is copied from the list passed in as a parameter, into the internal buffer hold by the blob
- Parameters
-
◆ blob() [4/4]
SPL::blob::blob |
( |
const blob & |
ot |
) |
|
Copy constructor
- Parameters
-
◆ ~blob()
◆ operator=()
blob& SPL::blob::operator= |
( |
const blob & |
ot |
) |
|
Assignment operator
- Parameters
-
- Returns
- self
◆ operator+=() [1/3]
blob& SPL::blob::operator+= |
( |
const blob & |
ot |
) |
|
Concatenation operator
- Parameters
-
- Returns
- self (with appended contents)
◆ operator+=() [2/3]
Concatenation operator
- Parameters
-
- Returns
- self (with appended contents)
◆ operator+=() [3/3]
blob& SPL::blob::operator+= |
( |
const List & |
bytes |
) |
|
Concatenation operator
- Parameters
-
bytes |
list of bytes to be appended |
- Returns
- self (with appended contents)
◆ append()
void SPL::blob::append |
( |
unsigned char const * |
data, |
|
|
uint64_t |
size |
|
) |
|
|
Append to a blob
- Parameters
-
data |
bytes to be appended |
size |
number of bytes to be appended |
◆ operator+()
blob SPL::blob::operator+ |
( |
const blob & |
ot |
) |
const |
Concatenation operator
- Parameters
-
ot |
blob to concatenate to |
- Returns
- blob containing concatenation of *this and ot
◆ operator==()
bool SPL::blob::operator== |
( |
const blob & |
ot |
) |
const |
Equality comparison operator
- Parameters
-
- Returns
- true if equal, false otherwise
◆ operator!=()
bool SPL::blob::operator!= |
( |
const blob & |
ot |
) |
const |
|
inline |
Non-equality comparison operator
- Parameters
-
- Returns
- true if not equal, false otherwise
◆ operator<()
bool SPL::blob::operator< |
( |
const blob & |
ot |
) |
const |
Less than comparison operator
- Parameters
-
- Returns
- true if less than, false otherwise
◆ operator>=()
bool SPL::blob::operator>= |
( |
const blob & |
ot |
) |
const |
|
inline |
Greater than or equal comparison operator
- Parameters
-
- Returns
- true if greater than or equal, false otherwise
◆ operator>()
bool SPL::blob::operator> |
( |
const blob & |
ot |
) |
const |
Greater than comparison operator
- Parameters
-
- Returns
- true if greater than, false otherwise
◆ operator<=()
bool SPL::blob::operator<= |
( |
const blob & |
ot |
) |
const |
|
inline |
Less than or equal comparison operator
- Parameters
-
- Returns
- true if less than or equal, false otherwise
◆ clear()
void SPL::blob::clear |
( |
|
) |
|
|
inline |
◆ operator[]() [1/2]
unsigned char const& SPL::blob::operator[] |
( |
uint64_t |
idx |
) |
const |
Element access (read-only)
- Parameters
-
- Returns
- byte at index idx
◆ at() [1/2]
unsigned char const& SPL::blob::at |
( |
uint64_t |
idx |
) |
const |
|
inline |
Element access (read-only)
- Parameters
-
- Returns
- byte at index idx
◆ operator[]() [2/2]
unsigned char& SPL::blob::operator[] |
( |
uint64_t |
idx |
) |
|
Element access (read-write)
- Parameters
-
- Returns
- byte at index idx
◆ at() [2/2]
unsigned char& SPL::blob::at |
( |
uint64_t |
idx |
) |
|
|
inline |
Element access (read-write)
- Parameters
-
- Returns
- byte at index idx
◆ getSize()
uint64_t SPL::blob::getSize |
( |
|
) |
const |
|
inline |
Get the size of the blob
- Returns
- size of the blob
◆ getData() [1/2]
unsigned char const* SPL::blob::getData |
( |
uint64_t & |
size |
) |
const |
|
inline |
Get a pointer to the data of the blob. The management of the returned memory block still belongs to the blob object.
- Parameters
-
size |
this is an out-param used to return the size of the blob's data |
- Returns
- pointer to the data of the blob
◆ getData() [2/2]
unsigned char const* SPL::blob::getData |
( |
|
) |
const |
|
inline |
Get a pointer to the data of the blob. The management of the returned memory block still belongs to the blob object.
- Returns
- pointer to the data of the blob
◆ setData()
void SPL::blob::setData |
( |
unsigned char const * |
data, |
|
|
uint64_t |
size |
|
) |
|
|
Set the data of the blob. The data is copied from the memory block passed in as a parameter, into the internal buffer hold by the blob. The blob owns the copied in memory.
- Parameters
-
data |
pointer to the memory block to be used for copying data |
size |
size of the memory block to be used for copying data |
◆ adoptData()
void SPL::blob::adoptData |
( |
unsigned char * |
data, |
|
|
uint64_t |
size |
|
) |
|
|
Set the data of the blob by taking over the management of the memory block passed in as a parameter. No copies are performed.
- Parameters
-
data |
pointer to the memory block to be adopted |
size |
size of the memory block to be adopted |
◆ releaseData()
unsigned char* SPL::blob::releaseData |
( |
uint64_t & |
size |
) |
|
Get a pointer to the data of the blob, and at the same time disassociate the blob from its data. The management of the returned memory block now does not belong to this blob anymore.
- Precondition
- ownsData() == true;
- Parameters
-
size |
this is an in-param used to return the size of the blob's data |
- Returns
- pointer to the data of the blob
- Exceptions
-
SPLRuntimeBlobNotOwnedException |
if !ownsData() |
◆ swap()
void SPL::blob::swap |
( |
blob & |
ot |
) |
|
Swap with another blob
- Parameters
-
◆ ownsData()
bool SPL::blob::ownsData |
( |
|
) |
const |
|
inline |
Does this blob own the data, or it is holding memory owned by someone else?
- Returns
- true if the blob owns the data
◆ useExternalData()
void SPL::blob::useExternalData |
( |
unsigned char * |
data, |
|
|
uint64_t |
size |
|
) |
|
|
|
inline |
Use external data in the blob. No copies will be done. This memory will NOT be freed when the blob is destroyed. It is the responsibility of the developer to ensure that the memory remains allocated for the duration of the blob object.
- Parameters
-
data |
pointer to the memory block to be used |
size |
size of the memory block to be used |
◆ serialize() [1/2]
template<class BufferType >
void SPL::blob::serialize |
( |
ByteBuffer< BufferType > & |
buf |
) |
const |
|
inline |
Serialize (binary)
- Parameters
-
◆ deserialize() [1/2]
template<class BufferType >
void SPL::blob::deserialize |
( |
ByteBuffer< BufferType > & |
buf |
) |
|
|
inline |
Deserialize (binary)
- Parameters
-
◆ serialize() [2/2]
void SPL::blob::serialize |
( |
std::ostream & |
ostr |
) |
const |
Serialize (character)
- Parameters
-
◆ deserialize() [2/2]
void SPL::blob::deserialize |
( |
std::istream & |
istr |
) |
|
Deserialize (character)
- Parameters
-
◆ hashCode()
size_t SPL::blob::hashCode |
( |
|
) |
const |
Get hash code
- Returns
- hash code
◆ getSerializedSize()
size_t SPL::blob::getSerializedSize |
( |
|
) |
const |
|
inline |
Get the size in bytes when serialized
- Returns
- size in bytes when serialized
The documentation for this class was generated from the following file: