Template Class pointer< T, 0 >#
Defined in File pointer.h
Nested Relationships#
Nested Types#
Class Documentation#
-
template<typename T>
class pointer<T, 0># Specialization for dynamic sized buffer management.
- Template Parameters:
T – Type to use for the buffer allocation.
Public Functions
-
pointer() noexcept#
Default constructor.
-
pointer(const pointer &rptr)#
Copy constructor of same pointer type.
- Parameters:
rptr – [in] Reference to the pointer to copy.
-
template<size_t nFixedSize2>
pointer(const pointer<T, nFixedSize2> &rptr)# Copy constructor of other pointer types.
- Template Parameters:
nFixedSize2 – The fixed size of the provided pointer.
- Parameters:
rptr – [in] Reference to the pointer to copy.
-
pointer(pointer &&rptr) noexcept#
Move constructor.
- Parameters:
rptr – [in] Reference to the pointer to move.
-
template<size_t nFixedSize2>
pointer(const pointer<T, nFixedSize2> &&rptr)# Move constructor of other pointer types.
- Template Parameters:
nFixedSize2 – The fixed size of the provided pointer.
- Parameters:
rptr – [in] Reference to the pointer to copy.
-
~pointer()#
Destructor.
-
pointer &operator=(const pointer &rptr)#
Assignment operator of same pointer type.
- Parameters:
rptr – [in] Reference to the pointer to assign.
- Returns:
Reference to this pointer.
-
template<size_t nFixedSize2>
pointer &operator=(const pointer<T, nFixedSize2> &rptr)# Assignment operator of other pointer types.
- Parameters:
rptr – [in] Reference to the pointer to assign.
- Returns:
Reference to this pointer.
-
pointer &operator=(pointer &&rptr) noexcept#
Move operator of same pointer type.
- Parameters:
rptr – [in] Reference to the pointer to move.
- Returns:
Reference to this pointer.
-
template<size_t nFixedSize2>
pointer &operator=(pointer<T, nFixedSize2> &&rptr)# Move operator of other pointer types.
- Parameters:
rptr – [in] Reference to the pointer to assign.
- Returns:
Reference to this pointer.
-
void reset()#
Reduces the reference count and if zero deletes the allocation. Clears the pointer.
-
template<size_t nFixedSizeRight>
void swap(pointer<T, nFixedSizeRight> &rptr)# Swaps this pointer with the provided pointer. tparam nFixedSizeRight The fixed size of the provided pointer.
- Parameters:
rptr – [in] Reference to the provided pointer to swap with.
-
element_type *get() const noexcept#
Get access to the underlying buffer.
- Returns:
Pointer to the buffer.
-
element_type &operator[](size_t nIndex) const#
Get the indexed value of the pointer.
- Parameters:
nIndex – [in] Index to request the value of.
- Returns:
Reference to the indexed value.
-
operator bool() const noexcept#
Return whether a pointer is assigned.
- Returns:
Returns ‘true’ when a pointer is assigned; ‘false’ otherwise.
-
size_t size() const noexcept#
Return the amount of elements allocated for this pointer.
- Returns:
The size of the pointer.
-
void resize(size_t nSize)#
Resize the pointer.
- Attention
A call to this function is not synchronized with other functions.
- Parameters:
nSize – [in] Size of the new pointer.
-
size_t capacity() const noexcept#
Return the capacity (in amount of elements) this buffer can hold.
- Returns:
The capacity of the buffer pointed to by this pointer.
-
size_t ref_count() const noexcept#
Get reference count on current shares.
- Returns:
Reference count.