Inherits tpie::array_view_base< const T >.
|
|
| array_view (array_view< T > o) |
| |
|
template<typename A > |
| | array_view (const std::vector< T, A > &v) |
| |
|
| array_view (const tpie::array< T > &v) |
| |
|
| array_view (const tpie::internal_vector< T > &v) |
| |
|
template<typename A > |
| | array_view (const std::vector< T, A > &v, size_t start, size_t end) |
| |
|
| array_view (const tpie::array< T > &v, size_t start, size_t end) |
| |
|
| array_view (const T *start, const T *end) |
| |
|
| array_view (const T *start, size_t size) |
| |
| iterator | find (size_t idx) const throw () |
| | Return an iterator to the i'th element of the array. More...
|
| |
| const T & | at (size_t i) const throw () |
| | Return the element located at the given index. More...
|
| |
| bool | empty () const |
| | Check if the array is empty. More...
|
| |
| size_t | size () const |
| | Get number of elements in the array. More...
|
| |
| const T & | operator[] (size_t i) const |
| | Return a reference to an array entry. More...
|
| |
| bool | operator== (const array_view_base &other) const |
| | Check if the other array has the same elements in the same order as this. More...
|
| |
| bool | operator!= (const array_view_base &other) const |
| | Check if the two arrays differ. More...
|
| |
| iterator | begin () const |
| | Return an iterator to the beginning of the array. More...
|
| |
| iterator | end () const |
| | Return an iterator to the end of the array. More...
|
| |
| const T & | front () const |
| | Return the first element in the array. More...
|
| |
| const T & | back () const |
| | Return the last element in the array. More...
|
| |
template<typename T>
class tpie::array_view< const T >
Definition at line 111 of file array_view.h.
◆ value_type
◆ at()
Return the element located at the given index.
- Parameters
-
| i | The index of the element returned. |
Definition at line 92 of file array_view_base.h.
◆ back()
◆ begin()
Return an iterator to the beginning of the array.
- Returns
- An iterator to the beginning of the array.
Definition at line 151 of file array_view_base.h.
151 {
return iterator(m_start);}
◆ empty()
Check if the array is empty.
- Returns
- True if and only if size is 0.
Definition at line 102 of file array_view_base.h.
102 {
return m_end == m_start;}
◆ end()
Return an iterator to the end of the array.
- Returns
- An iterator to the end of the array.
Definition at line 158 of file array_view_base.h.
158 {
return iterator(m_end);}
◆ find()
Return an iterator to the i'th element of the array.
- Parameters
-
| idx | The index of the element we want an iterator to. |
- Returns
- An iterator to the i'th element.
Definition at line 82 of file array_view_base.h.
83 assert(idx <=
size());
84 return iterator(m_start + idx);
◆ front()
◆ operator!=()
Check if the two arrays differ.
- Parameters
-
| other | The array to compare against. |
- Returns
- false If they are equal otherwise true.
Definition at line 140 of file array_view_base.h.
141 if (
size() != other.size())
return true;
142 for (
size_t i=0; i<
size(); ++i)
if (
at(i) != other.at(i))
return true;
◆ operator==()
Check if the other array has the same elements in the same order as this.
- Parameters
-
| other | The array to compare against. |
- Returns
- True if they are equal, otherwise false.
Definition at line 128 of file array_view_base.h.
129 if (
size() != other.size())
return false;
130 for (
size_t i=0; i <
size(); ++i)
if (
at(i) != other.at(i))
return false;
◆ operator[]()
Return a reference to an array entry.
- Parameters
-
| i | The index of the entry to return. |
- Returns
- Reference to the entry.
Definition at line 116 of file array_view_base.h.
◆ size()
Get number of elements in the array.
- Returns
- Number of elements in the array.
Definition at line 108 of file array_view_base.h.
108 {
return m_end - m_start;}
The documentation for this class was generated from the following file: