Lines Matching refs:T
35 template <class T>
47 class iterator : public std::iterator<std::forward_iterator_tag, T> {
49 iterator(T* ptr, size_t size, size_t pos, size_t ctr);
59 T& operator*();
61 T* operator->();
64 T* mPtr;
73 class const_iterator : public std::iterator<std::forward_iterator_tag, T> {
75 const_iterator(const T* ptr, size_t size, size_t pos, size_t ctr);
85 const T& operator*();
87 const T* operator->();
90 const T* mPtr;
103 void add(const T& item);
112 void add(T&& item);
148 T& operator[](size_t index);
154 const T& operator[](size_t index) const;
169 std::vector<T> mBuffer;
173 template <class T>
174 RingBuffer<T>::RingBuffer(size_t length) : mFrontIdx{0}, mMaxBufferSize{length} {} in RingBuffer()
176 template <class T>
177 RingBuffer<T>::iterator::iterator(T* ptr, size_t size, size_t pos, size_t ctr) : in iterator()
180 template <class T>
181 typename RingBuffer<T>::iterator& RingBuffer<T>::iterator::operator++() {
193 template <class T>
194 typename RingBuffer<T>::iterator RingBuffer<T>::iterator::operator++(int) {
200 template <class T>
201 bool RingBuffer<T>::iterator::operator==(const iterator& rhs) {
205 template <class T>
206 bool RingBuffer<T>::iterator::operator!=(const iterator& rhs) {
210 template <class T>
211 T& RingBuffer<T>::iterator::operator*() {
215 template <class T>
216 T* RingBuffer<T>::iterator::operator->() {
220 template <class T>
221 RingBuffer<T>::const_iterator::const_iterator(const T* ptr, size_t size, size_t pos, size_t ctr) : in const_iterator()
224 template <class T>
225 typename RingBuffer<T>::const_iterator& RingBuffer<T>::const_iterator::operator++() {
237 template <class T>
238 typename RingBuffer<T>::const_iterator RingBuffer<T>::const_iterator::operator++(int) {
244 template <class T>
245 bool RingBuffer<T>::const_iterator::operator==(const const_iterator& rhs) {
249 template <class T>
250 bool RingBuffer<T>::const_iterator::operator!=(const const_iterator& rhs) {
254 template <class T>
255 const T& RingBuffer<T>::const_iterator::operator*() {
259 template <class T>
260 const T* RingBuffer<T>::const_iterator::operator->() {
264 template <class T>
265 void RingBuffer<T>::add(const T& item) { in add()
276 template <class T>
277 void RingBuffer<T>::add(T&& item) { in add()
279 mBuffer.push_back(std::forward<T>(item)); in add()
285 mBuffer[mFrontIdx] = std::forward<T>(item); in add()
289 template <class T>
291 void RingBuffer<T>::emplace(Args&&... args) { in emplace()
299 mBuffer[mFrontIdx] = T(std::forward<Args>(args)...); in emplace()
303 template <class T>
304 typename RingBuffer<T>::iterator RingBuffer<T>::begin() { in begin()
309 template <class T>
310 typename RingBuffer<T>::iterator RingBuffer<T>::end() { in end()
315 template <class T>
316 typename RingBuffer<T>::const_iterator RingBuffer<T>::begin() const { in begin()
322 template <class T>
323 typename RingBuffer<T>::const_iterator RingBuffer<T>::end() const { in end()
328 template <class T>
329 T& RingBuffer<T>::operator[](size_t index) {
337 template <class T>
338 const T& RingBuffer<T>::operator[](size_t index) const {
346 template <class T>
347 size_t RingBuffer<T>::size() const { in size()
351 template <class T>
352 void RingBuffer<T>::clear() { in clear()