# QairtBuffer

Note

Some methods in this module are not yet implemented in the current release
and will raise an exception if called. See the C API for full functionality.

**Include:** `#include "QairtCppApi/QairtBuffer.hpp"`

C++ buffer types for passing data to and from the QAIRT API.

- namespace qairt

    - Functions

- template&lt;typename ...Ts&gt;  
std::shared\_ptr&lt;[VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE)&lt;[Ts](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt10makeBufferENSt10shared_ptrI12VectorBufferIDp2TsEEENSt6vectorIDp2TsEE)...&gt;&gt; makeBuffer(std::vector&lt;[Ts](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt10makeBufferENSt10shared_ptrI12VectorBufferIDp2TsEEENSt6vectorIDp2TsEE)...&gt; vec)

    - 

- template&lt;typename T&gt;  
std::shared\_ptr&lt;[VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE)&lt;[T](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt10makeBufferENSt10shared_ptrI12VectorBufferI1TEEENSt6vectorI1TEE)&gt;&gt; makeBuffer(std::vector&lt;[T](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt10makeBufferENSt10shared_ptrI12VectorBufferI1TEEENSt6vectorI1TEE)&gt; vec)

    -

- class Buffer

    - *#include &lt;QairtBuffer.hpp&gt;*

Abstract base class representing a contiguous block of byte data.

Use one of the concrete subclasses — [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#structqairt_1_1VectorBuffer), [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1RawBuffer), or [OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1OwnedBuffer) — to hold tensor data when calling QAIRT APIs. A typed view of the underlying bytes can be obtained via [view&lt;T&gt;()](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1Buffer_1afee4f828f57b8f55aa0359ef8b2ed6d7).

Subclassed by [qairt::OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1OwnedBuffer), [qairt::RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1RawBuffer), [qairt::VectorBuffer&lt; T\_VectorParams &gt;](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#structqairt_1_1VectorBuffer)

Public Functions

- virtual ~Buffer() = default

    - 

- virtual void \*getData() = 0

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Pointer to the first byte, or nullptr if the buffer is empty.

- virtual const void \*getData() const = 0

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Const pointer to the first byte, or nullptr if the buffer is empty.

- virtual uint64\_t getDataSize() const = 0

    - Get the total number of bytes in this buffer.

- Returns

    - Byte count.

- template&lt;typename T&gt;  
inline [BufferView](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt10BufferViewE)&lt;[T](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt6Buffer4viewE10BufferViewI1TEv)&gt; view()

    - Get a typed view over the buffer’s contents.

- Template Parameters

    - **T** – Element type for the view. Must not be a reference, pointer, const, or volatile type.

- Throws

    - std::runtime\_error – if the byte size is not a multiple of sizeof(T).

- Returns

    - A BufferView&lt;T&gt; spanning the entire buffer.

Protected Functions

- Buffer() = default

    - 

- Buffer(const [Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6Buffer6BufferERK6Buffer)&) = default

    - 

- Buffer([Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6Buffer6BufferERR6Buffer)&&) noexcept = default

    - 

- [Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6BufferE) &operator=(const [Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6BufferE)&) = default

    - 

- [Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6BufferE) &operator=([Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6BufferE)&&) noexcept = default

    -

- template&lt;typename T&gt;  
class BufferView

    - *#include &lt;QairtBuffer.hpp&gt;*

Non-owning typed view over a contiguous range of elements.

- Template Parameters

    - **T** – Element type. Must not be a reference, pointer, const, or volatile type.

Public Types

- using value\_type = [T](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt10BufferViewE)

    - 

- using size\_type = std::size\_t

    - 

- using difference\_type = std::ptrdiff\_t

    - 

- using reference = [value\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView10value_typeE)&

    - 

- using const\_reference = const [value\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView10value_typeE)&

    - 

- using pointer = [value\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView10value_typeE)\*

    - 

- using const\_pointer = const [value\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView10value_typeE)\*

    - 

- using iterator = [pointer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView7pointerE)

    - 

- using const\_iterator = [const\_pointer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView13const_pointerE)

    - 

- using reverse\_iterator = std::reverse\_iterator&lt;[iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView8iteratorE)&gt;

    - 

- using const\_reverse\_iterator = std::reverse\_iterator&lt;[const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView14const_iteratorE)&gt;

    -

Public Functions

- constexpr BufferView() noexcept = default

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9referenceE) at([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9size_typeE) pos)

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView15const_referenceE) at([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9size_typeE) pos) const

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9referenceE) operator[]([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9size_typeE) pos)

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView15const_referenceE) operator[]([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9size_typeE) pos) const

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9referenceE) front()

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView15const_referenceE) front() const

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9referenceE) back()

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView15const_referenceE) back() const

    - 

- inline [T](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt10BufferViewE) \*data()

    - 

- inline const [T](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt10BufferViewE) \*data() const

    - 

- inline [iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView8iteratorE) begin()

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView14const_iteratorE) begin() const

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView14const_iteratorE) cbegin() const noexcept

    - 

- inline [iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView8iteratorE) end()

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView14const_iteratorE) end() const

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView14const_iteratorE) cend() const noexcept

    - 

- inline [reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView16reverse_iteratorE) rbegin()

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView22const_reverse_iteratorE) rbegin() const

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView22const_reverse_iteratorE) rcbegin() const noexcept

    - 

- inline [reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView16reverse_iteratorE) rend()

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView22const_reverse_iteratorE) rend() const

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView22const_reverse_iteratorE) rcend() const noexcept

    - 

- inline [size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView9size_typeE) size() const

    - 

- inline bool empty() const

    -

Private Functions

- inline constexpr BufferView([pointer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView7pointerE) data, size\_t size) noexcept

    -

Private Members

- [pointer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt10BufferView7pointerE) m\_data = {}

    - Non-owning pointer to the first element of the viewed memory range.

- size\_t m\_size = {}

    - Number of elements of type T in the viewed range.

Friends

- *friend class* Buffer

- class OwnedBuffer : public [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6BufferE)

    - *#include &lt;QairtBuffer.hpp&gt;*

[Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1Buffer) that owns heap memory and releases it via a caller-supplied deleter.

Public Functions

- OwnedBuffer() = default

    - 

- OwnedBuffer(const [OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt11OwnedBuffer11OwnedBufferERK11OwnedBuffer)&) = delete

    - 

- [OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt11OwnedBufferE) &operator=(const [OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt11OwnedBufferE)&) = delete

    - 

- OwnedBuffer([OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt11OwnedBuffer11OwnedBufferERR11OwnedBuffer)&&) noexcept = default

    - 

- [OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt11OwnedBufferE) &operator=([OwnedBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt11OwnedBufferE)&&) noexcept = default

    - 

- inline OwnedBuffer(void \*data, std::function&lt;void(void\*)&gt; freer, uint64\_t dataSize)

    - 

- template&lt;typename T\_Type, typename T\_Deleter&gt;  
inline OwnedBuffer(std::unique\_ptr&lt;[T\_Type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I00EN5qairt11OwnedBuffer11OwnedBufferENSt10unique_ptrI6T_Type9T_DeleterEE8uint64_t), [T\_Deleter](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I00EN5qairt11OwnedBuffer11OwnedBufferENSt10unique_ptrI6T_Type9T_DeleterEE8uint64_t)&gt; ptr, uint64\_t dataSize)

    - 

- inline virtual void \*getData() override

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Pointer to the first byte, or nullptr if the buffer is empty.

- inline virtual const void \*getData() const override

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Const pointer to the first byte, or nullptr if the buffer is empty.

- inline virtual uint64\_t getDataSize() const override

    - Get the total number of bytes in this buffer.

- Returns

    - Byte count.

- inline void setData(void \*data, std::function&lt;void(void\*)&gt; freer) noexcept

    - 

- inline void setDataSize(uint64\_t dataSize) noexcept

    - 

- inline [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE) asNonOwningBuffer()

    -

Private Members

- std::unique\_ptr&lt; void, std::function&lt; void(void \*)&gt; m\_data )

    - Owning pointer to the buffer data; the stored deleter frees it on destruction.

- uint64\_t m\_dataSize

    - Number of valid bytes beginning at the address held by m\_data.

- class RawBuffer : public [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6BufferE)

    - *#include &lt;QairtBuffer.hpp&gt;*

Non-owning [Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1Buffer) wrapper around a raw pointer and byte size.

Public Functions

- RawBuffer() = default

    - 

- RawBuffer(const [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBuffer9RawBufferERK9RawBuffer)&) = default

    - 

- [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE) &operator=(const [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE)&) = default

    - 

- RawBuffer([RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBuffer9RawBufferERR9RawBuffer)&&) noexcept = default

    - 

- [RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE) &operator=([RawBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt9RawBufferE)&&) noexcept = default

    - 

- inline RawBuffer(void \*data, uint64\_t dataSize)

    - 

- inline virtual void \*getData() override

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Pointer to the first byte, or nullptr if the buffer is empty.

- inline virtual const void \*getData() const override

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Const pointer to the first byte, or nullptr if the buffer is empty.

- inline virtual uint64\_t getDataSize() const override

    - Get the total number of bytes in this buffer.

- Returns

    - Byte count.

- inline void setData(void \*data) noexcept

    - 

- inline void setDataSize(uint64\_t dataSize) noexcept

    -

Private Members

- void \*m\_data = {}

    - Non-owning pointer to the buffer data.

- uint64\_t m\_dataSize = {}

    - Number of valid bytes beginning at m\_data.

- template&lt;typename ...T\_VectorParams&gt;  
struct VectorBuffer : public [qairt](https://docs.qualcomm.com/doc/80-63442-10/topic/cpp-api_QairtLog.html#_CPPv45qairt)::[Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt6BufferE)

    - *#include &lt;QairtBuffer.hpp&gt;*

[Buffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#classqairt_1_1Buffer) adapter that owns data as a std::vector.

- Template Parameters

    - **T\_VectorParams** – Template parameters forwarded to std::vector.

Public Types

- using vector\_type = std::vector&lt;[T\_VectorParams](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE)...&gt;

    - 

- using value\_type = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::value\_type

    - 

- using allocator\_type = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::allocator\_type

    - 

- using size\_type = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::size\_type

    - 

- using difference\_type = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::difference\_type

    - 

- using reference = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::reference

    - 

- using const\_reference = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::const\_reference

    - 

- using pointer = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::pointer

    - 

- using const\_pointer = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::const\_pointer

    - 

- using iterator = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::iterator

    - 

- using const\_iterator = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::const\_iterator

    - 

- using reverse\_iterator = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::reverse\_iterator

    - 

- using const\_reverse\_iterator = typename [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE)::const\_reverse\_iterator

    -

Public Functions

- VectorBuffer() = default

    - 

- VectorBuffer(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer12VectorBufferERK12VectorBuffer)&) = delete

    - 

- [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &operator=(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE)&) = delete

    - 

- VectorBuffer([VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer12VectorBufferERR12VectorBuffer)&&) noexcept = default

    - 

- [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &operator=([VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE)&&) noexcept = default

    - 

- inline explicit VectorBuffer([vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE) &&vector)

    - 

- inline explicit VectorBuffer(const [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE) &vector)

    - 

- inline virtual void \*getData() override

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Pointer to the first byte, or nullptr if the vector is empty.

- inline virtual const void \*getData() const override

    - Get a pointer to the start of the buffer’s byte data.

- Returns

    - Const pointer to the first byte, or nullptr if the vector is empty.

- inline virtual uint64\_t getDataSize() const override

    - Get the total number of bytes in this buffer.

- Throws

    - std::runtime\_error – if the resulting byte count would overflow uint64\_t.

- Returns

    - Byte count: number of elements multiplied by sizeof(value\_type).

- inline [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &operator=(const [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE) &other)

    - 

- inline [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &operator=([vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE) &&other) noexcept

    - 

- template&lt;typename ...T\_Args&gt;  
inline void assign([T\_Args](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBuffer6assignEvDpRR6T_Args)&&... args)

    - 

- inline [allocator\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer14allocator_typeE) get\_allocator() const

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9referenceE) at([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) pos)

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer15const_referenceE) at([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) pos) const

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9referenceE) operator[]([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) pos)

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer15const_referenceE) operator[]([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) pos) const

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9referenceE) front()

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer15const_referenceE) front() const

    - 

- inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9referenceE) back()

    - 

- inline [const\_reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer15const_referenceE) back() const

    - 

- inline [pointer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer7pointerE) data() noexcept

    - 

- inline [const\_pointer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer13const_pointerE) data() const noexcept

    - 

- inline [iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer8iteratorE) begin() noexcept

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer14const_iteratorE) begin() const noexcept

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer14const_iteratorE) cbegin() const noexcept

    - 

- inline [iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer8iteratorE) end() noexcept

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer14const_iteratorE) end() const noexcept

    - 

- inline [const\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer14const_iteratorE) cend() const noexcept

    - 

- inline [reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer16reverse_iteratorE) rbegin() noexcept

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer22const_reverse_iteratorE) rbegin() const noexcept

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer22const_reverse_iteratorE) crbegin() const noexcept

    - 

- inline [reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer16reverse_iteratorE) rend() noexcept

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer22const_reverse_iteratorE) rend() const noexcept

    - 

- inline [const\_reverse\_iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer22const_reverse_iteratorE) crend() const noexcept

    - 

- inline bool empty() const noexcept

    - 

- inline [size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) size() const noexcept

    - 

- inline [size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) max\_size() const noexcept

    - 

- inline void reserve([size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) newCap)

    - 

- inline [size\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9size_typeE) capacity() const noexcept

    - 

- inline void shrink\_to\_fit()

    - 

- inline void clear()

    - 

- template&lt;typename ...T\_Args&gt;  
inline [iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer8iteratorE) insert([T\_Args](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBuffer6insertE8iteratorDpRR6T_Args)&&... args)

    - 

- template&lt;typename ...T\_Args&gt;  
inline [iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer8iteratorE) emplace([T\_Args](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBuffer7emplaceE8iteratorDpRR6T_Args)&&... args)

    - 

- template&lt;typename ...T\_Args&gt;  
inline [iterator](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer8iteratorE) erase([T\_Args](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBuffer5eraseE8iteratorDpRR6T_Args)&&... args)

    - 

- template&lt;typename T\_Arg&gt;  
inline void push\_back([T\_Arg](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4I0EN5qairt12VectorBuffer9push_backEvRR5T_Arg) &&arg)

    - 

- template&lt;typename ...T\_Args&gt;  
inline [reference](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer9referenceE) emplace\_back([T\_Args](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBuffer12emplace_backE9referenceDpRR6T_Args)&&... args)

    - 

- inline void pop\_back()

    - 

- template&lt;typename ...T\_Args&gt;  
inline void resize([T\_Args](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBuffer6resizeEvDpRR6T_Args)&&... args)

    - 

- inline void swap([VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &other) noexcept

    - 

- inline void swap([vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE) &otherVector) noexcept

    -

Private Members

- [vector\_type](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4N5qairt12VectorBuffer11vector_typeE) m\_vector

    - Underlying vector that owns the buffer’s data.

Friends

- inline friend bool operator==(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &lhs, const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &rhs)

    - 

- inline friend bool operator!=(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &lhs, const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &rhs)

    - 

- inline friend bool operator&lt;(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &lhs, const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &rhs)

    - 

- inline friend bool operator&lt;=(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &lhs, const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &rhs)

    - 

- inline friend bool operator&gt;(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &lhs, const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &rhs)

    - 

- inline friend bool operator&gt;=(const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &lhs, const [VectorBuffer](https://docs.qualcomm.com/doc/80-63442-10/topic/QairtBuffer.html#_CPPv4IDpEN5qairt12VectorBufferE) &rhs)

    -

Last Published: Jun 04, 2026

[Previous Topic
QairtDevice](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/cpp-api_QairtDevice.md) [Next Topic
QairtMem](https://docs.qualcomm.com/bundle/publicresource/80-63442-10/topics/cpp-api_QairtMem.md)