-
首页
-
C4D R23.110 C++ SDK
RingBuffer< ARRAYTYPE, RINGSIZE > Class Template Reference
#include <ringbuffer.h>
详细描述
template<typename ARRAYTYPE, Int RINGSIZE>
class maxon::RingBuffer< ARRAYTYPE, RINGSIZE >
Ring buffer array template. This class implements a ring buffer using your preferred ARRAY type.
-
Template Parameters
-
ARRAYTYPE
|
Type of the array.
|
RINGSIZE
|
Maximum number of elements in the ring buffer.
|
Member Typedef Documentation
using
T
= typename ARRAYTYPE::ValueType
|
◆
Iterator
◆
ConstIterator
成员函数文档编制
◆
Append()
[1/3]
Adds a new element at the end of the buffer and initializes it with a copy of x.
-
参数
-
[in]
|
t
|
Value to be copied.
|
-
返回
-
Element reference or OutOfMemoryError if the initial allocation failed.
◆
Append()
[2/3]
Adds a new element at the end of the buffer and moves the content of x to it.
-
参数
-
[in]
|
t
|
Value to be moved.
|
-
返回
-
Element reference or OutOfMemoryError if the initial allocation failed.
◆
Append()
[3/3]
Appends new elements at the end of the array.
-
参数
-
[in]
|
values
|
Initializer list with values to be copied.
|
-
返回
-
Element pointer or OutOfMemoryError if the allocation failed.
◆
operator[]()
[1/2]
Array
(subscript) operator for non-const objects. Index 0 is the oldest entry.
-
参数
-
[in]
|
idx
|
Element index (if it's out of bounds you will get an error in debug code only, otherwise it will crash).
|
-
返回
-
Array
element.
◆
operator[]()
[2/2]
Array
(subscript) operator for non-const objects. Index 0 is the oldest entry.
-
参数
-
[in]
|
idx
|
Element index (if it's out of bounds you will get an error in debug code only, otherwise it will crash).
|
-
返回
-
Array
element.
◆
GetFirst()
[1/2]
Returns a pointer to the first element in the ring buffer (which is different from the first element in the array).
-
返回
-
Pointer to the first element (nullptr if the buffer is empty).
◆
GetFirst()
[2/2]
Returns a pointer to the first element in the ring buffer (which is different from the first element in the array).
-
返回
-
Pointer to the first element (nullptr if the buffer is empty).
◆
GetLast()
[1/2]
Returns a pointer to the last element in the ring buffer (which is different from the last element in the array).
-
返回
-
Pointer to the last element (nullptr if the buffer is empty).
◆
GetLast()
[2/2]
Returns a pointer to the last element in the ring buffer (which is different from the last element in the array).
-
返回
-
Pointer to the last element (nullptr if the buffer is empty).
◆
Reset()
Deletes all elements (calls destructors and frees memory).
◆
Flush()
Deletes all elements, but doesn't free memory (calls destructors though).
◆
Begin()
[1/2]
Gets an iterator for the first element. When you modify the array
Begin()
will change, it is not a constant value.
-
返回
-
Iterator for the first element (equal to
End()
if the array is empty).
◆
Begin()
[2/2]
Gets an iterator for the first element. When you modify the array
Begin()
will change, it is not a constant value.
-
返回
-
Iterator for the first element (equal to
End()
if the array is empty).
◆
End()
[1/2]
Gets an iterator for the end (
End()
- 1 is the last element if the array is not empty). When you modify the array
End()
will change, it is not a constant value.
-
返回
-
Iterator for the array end (this is behind the last element).
◆
End()
[2/2]
Gets an iterator for the end (
End()
- 1 is the last element if the array is not empty). When you modify the array
End()
will change, it is not a constant value.
-
返回
-
Iterator for the array end (this is behind the last element).
Member Data Documentation
◆
_ringPos