15 BEGIN_NAMESPACE_MEMORY
20 template <
typename T,
typename I>
30 std::recursive_mutex& getLock()
override 35 T* getData()
const override 40 size_t getCapacity()
const override 46 std::recursive_mutex lock;
67 std::lock_guard<std::recursive_mutex> guard(this->getLock());
73 std::lock_guard<std::recursive_mutex> guard(this->getLock());
80 std::lock_guard<std::recursive_mutex> guard(this->getLock());
103 delete[] this->getData();
110 template <
typename T>
116 , remainingSize(capacity)
123 std::lock_guard<std::recursive_mutex> guard(this->getLock());
129 std::lock_guard<std::recursive_mutex> guard(this->getLock());
131 remainingSize -= pos;
136 std::lock_guard<std::recursive_mutex> guard(this->getLock());
137 return remainingSize;
141 size_t remainingSize;
148 template <
typename T>
159 delete[] this->getData();
size_t getWritePos() override
Function returns current write position.
Definition: array_buffer.h:121
Array wrapper for buffer source.
Definition: array_buffer.h:55
Interfaces for buffers which are backed by the array (circular buffers, array buffers, ...). On such buffers data transfering is done without without intermediate buffer.
void incrementReadPosition(size_t pos) override
Function increments read position for N samples.
Definition: array_buffer.h:71
Base array wrapper implementation.
Definition: array_buffer.h:21
Array wrapper for buffer target.
Definition: array_buffer.h:111
void incrementWritePosition(size_t pos) override
Function increments write position for N samples.
Definition: array_buffer.h:127
size_t getRemainingSize() override
Function returns remaining size in samples.
Definition: array_buffer.h:134
size_t getReadPos() override
Function returns current read position.
Definition: array_buffer.h:65
Array target with internal data.
Definition: array_buffer.h:149
size_t getSize() override
Function returns current buffer size in samples.
Definition: array_buffer.h:78
Array source with internal data.
Definition: array_buffer.h:93