A simple object to simplify managing buffers. More...
#include <buffer.h>
Public Member Functions | |
Buffer (const Buffer &)=delete | |
Buffer & | operator= (Buffer const &)=delete |
Buffer (Buffer &&o)=delete | |
Buffer & | operator= (Buffer &&o)=delete |
virtual | ~Buffer () |
Virtual destructor. More... | |
BufferType | getType () const noexcept |
Get the type of buffer the object holds. More... | |
size_t | getSize () const noexcept |
Get the size of the contained buffer. More... | |
virtual void * | data ()=0 |
Abstract method returning void pointer to buffer. More... | |
Protected Member Functions | |
Buffer (const BufferType bufferType, const size_t size) | |
Protected constructor of abstract type Buffer . More... | |
Protected Attributes | |
BufferType | _bufferType {BufferType::Invalid} |
Buffer type. | |
size_t | _size |
Buffer size. | |
A simple object to simplify managing buffers.
UCXX can work with raw pointers in most cases, but in some circumstances it's required to know more information about the buffer, such as with ucxx::RequestTagMulti
. In such circumstances it may need to allocate buffers internally and UCXX can utilize objects of this type to describe the internally-allocated buffers.
|
protected |
Protected constructor of abstract type Buffer
.
This is the constructor that should be called by derived classes to store general information about the buffer, such as its type and size.
[in] | bufferType | the type of buffer the object holds. |
[in] | size | the size of the contained buffer. |
|
virtual |
Virtual destructor.
Virtual destructor with empty implementation.
|
pure virtual |
Abstract method returning void pointer to buffer.
Get the void pointer to the underlying buffer that holds the data. This is meant to return the actual allocation, and not a pointer to some container to the buffer it holds.
Implemented in ucxx::HostBuffer.
|
noexcept |
Get the size of the contained buffer.
The size in bytes of the contained buffer.
|
noexcept |
Get the type of buffer the object holds.
The type of buffer the object holds is important to ensure proper casting of the object into the correct derived type.