78 [[nodiscard]]
size_t getSize() const noexcept;
89 [[nodiscard]] virtual
void*
data() = 0;
189 [[nodiscard]]
void*
data()
override;
197 struct CCCLBufferImpl;
204 class CCCLBuffer :
public Buffer {
206 std::unique_ptr<CCCLBufferImpl> _impl;
209 CCCLBuffer() =
delete;
210 CCCLBuffer(
const CCCLBuffer&) =
delete;
211 CCCLBuffer& operator=(CCCLBuffer
const&) =
delete;
212 CCCLBuffer(CCCLBuffer&& o) =
delete;
213 CCCLBuffer& operator=(CCCLBuffer&& o) =
delete;
215 ~CCCLBuffer()
override;
231 explicit CCCLBuffer(
const size_t size);
248 [[nodiscard]]
void*
data()
override;
A simple object to simplify managing buffers.
Definition: buffer.h:31
Buffer(const BufferType bufferType, const size_t size)
Protected constructor of abstract type Buffer.
virtual ~Buffer()
Virtual destructor.
BufferType _bufferType
Buffer type.
Definition: buffer.h:33
size_t getSize() const noexcept
Get the size of the contained buffer.
BufferType getType() const noexcept
Get the type of buffer the object holds.
size_t _size
Buffer size.
Definition: buffer.h:34
virtual void * data()=0
Abstract method returning void pointer to buffer.
A simple object containing a host buffer.
Definition: buffer.h:97
void * release()
Release the allocated host buffer to the caller.
~HostBuffer()
Destructor of concrete type HostBuffer.
HostBuffer(const void *buffer, const size_t size)
Construct a host buffer by deep copying the contents of another buffer.
HostBuffer(const size_t size)
Constructor of concrete type HostBuffer.
void * data() override
Get a pointer to the allocated raw host buffer.
std::shared_ptr< Buffer > allocateBuffer(BufferType bufferType, const size_t size)
Allocate a buffer of specified type and size.
BufferType
The type of a buffer.
Definition: buffer.h:17