 |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Go to the documentation of this file.
6 #ifndef LLU_CONTAINERS_ITERATORS_ITERABLECONTAINER_HPP
7 #define LLU_CONTAINERS_ITERATORS_ITERABLECONTAINER_HPP
64 mint
size() const noexcept {
93 return std::next(
begin(), getSize());
100 return std::next(
begin(), getSize());
107 return std::next(
cbegin(), getSize());
114 return std::make_reverse_iterator(
end());
121 return std::make_reverse_iterator(
end());
128 return std::make_reverse_iterator(
cend());
135 return std::make_reverse_iterator(
begin());
142 return std::make_reverse_iterator(
begin());
149 return std::make_reverse_iterator(
cbegin());
157 return *(
begin() + index);
165 return *(
cbegin() + index);
197 return *(
cend() - 1);
204 [[nodiscard]] std::vector<value_type>
asVector()
const {
205 return std::vector<value_type> {
cbegin(),
cend()};
212 virtual T* getData() const noexcept = 0;
217 virtual mint getSize() const noexcept = 0;
222 #endif // LLU_CONTAINERS_ITERATORS_ITERABLECONTAINER_HPP
Abstract class that provides iterators (c/r/begin and c/r/end methods) and subscript operator for any...
Definition: IterableContainer.hpp:20
const_reference operator[](mint index) const
Get a constant reference to the data element at given position.
Definition: IterableContainer.hpp:164
value_type * data() noexcept
Get raw pointer to underlying data.
Definition: IterableContainer.hpp:50
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
const_reference front() const
Get constant reference to the first element.
Definition: IterableContainer.hpp:180
value_type * iterator
Iterator type.
Definition: IterableContainer.hpp:26
mint size() const noexcept
Get total number of elements in the container.
Definition: IterableContainer.hpp:64
reverse_iterator rend() noexcept
Get iterator after the end of underlying data.
Definition: IterableContainer.hpp:134
const value_type * const_iterator
Constant iterator type.
Definition: IterableContainer.hpp:29
const value_type * data() const noexcept
Get raw pointer to const underlying data.
Definition: IterableContainer.hpp:57
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator type.
Definition: IterableContainer.hpp:32
double value_type
Type of elements stored.
Definition: IterableContainer.hpp:23
std::vector< value_type > asVector() const
Copy contents of the data to a std::vector of matching type.
Definition: IterableContainer.hpp:204
const_reverse_iterator rend() const noexcept
Get constant iterator after the end of underlying data.
Definition: IterableContainer.hpp:141
reverse_iterator rbegin() noexcept
Get iterator at the beginning of underlying data.
Definition: IterableContainer.hpp:113
const_reverse_iterator crbegin() const noexcept
Get constant iterator at the beginning of underlying data.
Definition: IterableContainer.hpp:127
reference operator[](mint index)
Get a reference to the data element at given position.
Definition: IterableContainer.hpp:156
const_reverse_iterator rbegin() const noexcept
Get constant iterator at the beginning of underlying data.
Definition: IterableContainer.hpp:120
reference back()
Get reference to the last element.
Definition: IterableContainer.hpp:188
std::reverse_iterator< const_iterator > const_reverse_iterator
Constant reverse iterator type.
Definition: IterableContainer.hpp:35
const_iterator cbegin() const noexcept
Get constant iterator at the beginning of underlying data.
Definition: IterableContainer.hpp:85
reference front()
Get reference to the first element.
Definition: IterableContainer.hpp:172
const_iterator begin() const noexcept
Get constant iterator at the beginning of underlying data.
Definition: IterableContainer.hpp:78
const_iterator end() const noexcept
Get constant iterator after the end of underlying data.
Definition: IterableContainer.hpp:99
const_reference back() const
Get constant reference to the last element.
Definition: IterableContainer.hpp:196
const_iterator cend() const noexcept
Get constant iterator after the end of underlying data.
Definition: IterableContainer.hpp:106
iterator begin() noexcept
Get iterator at the beginning of underlying data.
Definition: IterableContainer.hpp:71
const_reverse_iterator crend() const noexcept
Get constant iterator after the end of underlying data.
Definition: IterableContainer.hpp:148
iterator end() noexcept
Get iterator after the end of underlying data.
Definition: IterableContainer.hpp:92
value_type & reference
Reference type.
Definition: IterableContainer.hpp:38
const value_type & const_reference
Constant reference type.
Definition: IterableContainer.hpp:41