An immutable object that encapsulates a pointer to a constant contiguous block of memory representing arbitrary binary data and a count of the number of bytes of data.
More...
#include <bond/types/dataview.h>
An immutable object that encapsulates a pointer to a constant contiguous block of memory representing arbitrary binary data and a count of the number of bytes of data.
DataView does not perform any allocations; it contains a pointer to an existing block of memory whose lifetime must supersede that of the DataView.
◆ DataView() [1/3]
Bond::DataView::DataView |
( |
| ) |
|
|
inline |
◆ DataView() [2/3]
Bond::DataView::DataView |
( |
const void * |
data, |
|
|
size_t |
length |
|
) |
| |
|
inline |
Constructs a DataView over the given pointer to a block of memory.
- Parameters
-
data | The pointer to a block of memory over which the view is created. |
length | The number of bytes of data. |
◆ DataView() [3/3]
Bond::DataView::DataView |
( |
const DataView & |
other | ) |
|
|
default |
◆ GetData()
const void * Bond::DataView::GetData |
( |
| ) |
const |
|
inline |
Returns the pointer to the block of memory over which the view has been created.
◆ GetLength()
size_t Bond::DataView::GetLength |
( |
| ) |
const |
|
inline |
Returns the number of bytes of data in the view.
◆ operator==()
bool Bond::DataView::operator== |
( |
const DataView & |
other | ) |
const |
|
inline |
Returns whether this DataView points to the same number of bytes at the same memory address as another DataView.
- Parameters
-
other | The DataView against which this one is compared. |
The documentation for this class was generated from the following file:
- include/bond/types/dataview.h