21 #ifndef CIRCULAR_ARRAY_H 22 #define CIRCULAR_ARRAY_H 79 size_t capacity() const noexcept;
86 size_t size() const noexcept;
95 T& at(ptrdiff_t index);
103 const T& at(ptrdiff_t index) const;
111 T& operator[](ptrdiff_t index);
119 const T& operator[](ptrdiff_t index) const;
128 size_t absoluteIndex(ptrdiff_t index) const noexcept;
136 T& atAbsoluteIndex(
size_t index);
144 const T& atAbsoluteIndex(
size_t index) const;
153 bool absoluteIndexIsInBounds(
size_t index) const noexcept;
168 const T& front() const;
182 const T& back() const;
190 void moveBegin(ptrdiff_t indexes) noexcept;
197 void moveEnd(ptrdiff_t indexes) noexcept;
203 void reset() noexcept;
210 void reset(
size_t capacity) noexcept;
218 void reset(
size_t capacity, const T& value) noexcept;
225 void reset(const T& value) noexcept;
229 #include "CircularArray.cc" 231 #endif // CIRCULAR_ARRAY_H size_t begin_
First index in internal storage.
size_t size_
Number of elements currently stored.
size_t capacity_
Number of elements that can be held in currently allocated storage.
Class to compute and store metric values variations.
std::vector< T > data_
Underlying data storage.