HostBufferBase#

Fully qualified name: isaacsim::core::includes::HostBufferBase

template<typename T>
class HostBufferBase : public isaacsim::core::includes::Buffer<T>#

Host (CPU) memory buffer implementation.

Manages a buffer of memory allocated in host RAM using std::vector. Provides a simple wrapper around std::vector with the Buffer interface.

Template Parameters:

T – The data type stored in the buffer

Public Functions

inline HostBufferBase(size_t size = 0)#

Constructs a new host buffer.

Parameters:

size[in] Initial size of the buffer in elements (default: 0)

inline virtual void resize(size_t size)#

Resizes the host buffer.

Parameters:

size[in] New size in number of elements

inline virtual void resize(size_t size, const T &val)#

Resizes the host buffer and initializes new elements.

Parameters:
  • size[in] New size in number of elements

  • val[in] Value to initialize new elements with

inline virtual T *data() const#

Gets a pointer to the host memory.

Returns:

Raw pointer to the host memory

inline virtual size_t size() const#

Gets the current size of the buffer.

Returns:

Number of elements in the buffer

inline size_t sizeofType() const#

Gets the size of a single element in bytes.

Returns:

Size of type T in bytes

inline size_t sizeInBytes() const#

Gets the total size of the buffer in bytes.

Returns:

Total size of the buffer in bytes

inline MemoryType type() const#

Gets the memory type of the buffer.

Returns:

Memory type (Host or Device)

Public Members

std::vector<T> m_buffer#

Underlying vector storing the data.

Protected Attributes

MemoryType m_memoryType#

Type of memory where the buffer resides.