|
Regina 7.4.1 Calculation Engine
|
A specialisation of ListView for working with lists stored in a C-style array whose size is not known at compile-time. More...
#include <utilities/listview.h>
Public Types | |
| using | value_type = Element |
| The type of element that is stored in this list. | |
| using | size_type = size_t |
| The type used for indexing into this list. | |
| using | reference = const Element& |
| A reference to a list element. | |
| using | const_reference = const Element& |
| A reference to a list element. | |
| using | iterator = const Element* |
| The iterator type for this list view. | |
| using | const_iterator = const Element* |
| The iterator type for this list view. | |
| using | value_type |
| The type of element that is stored in this list. | |
| using | size_type |
| The type used for indexing into this list. | |
| using | reference |
| A reference to a list element. | |
| using | const_reference |
| A reference to a list element. | |
| using | iterator |
| The iterator type for this list view. | |
| using | const_iterator |
| The iterator type for this list view. | |
Public Member Functions | |
| ListView (const Element *array, size_t size) | |
| Returns a view for the given C-style array, presented as an array with size. | |
| ListView (const Element *begin, const Element *end) | |
| Returns a view for the given C-style array, presented as an iterator pair. | |
| ListView (const ListView &)=default | |
| Creates a new copy of the given list view. | |
| ListView & | operator= (const ListView &)=default |
| Sets this to be a copy of the given list view. | |
| bool | empty () const |
| Determines if this list is empty. | |
| size_type | size () const |
| Returns the number of elements in this list. | |
| const_reference | operator[] (size_type index) const |
| Returns the requested element of this list. | |
| const_reference | front () const |
| Returns the first element of this list. | |
| const_reference | back () const |
| Returns the last element of this list. | |
| const_iterator | begin () const |
| Returns a C++ iterator pointing to the first element of this list. | |
| const_iterator | end () const |
| Returns a C++ iterator pointing beyond the last element of this list. | |
| auto | __iter__ () const |
| Returns a Python iterator over the elements of this list. | |
| bool | operator== (const ListView &) const =default |
| Determines whether this and the given list view are accessing the same underlying C-style array. | |
| ListView (const Element *&list) | |
| Returns a view for the given list. | |
| ListView (const ListView &)=default | |
| Creates a new copy of the given list view. | |
| ListView & | operator= (const ListView &)=default |
| Sets this to be a copy of the given list view. | |
| bool | empty () const |
| Determines if this list is empty. | |
| size_type | size () const |
| Returns the number of elements in this list. | |
| const_reference | operator[] (size_type index) const |
| Returns the requested element of this list. | |
| const_reference | front () const |
| Returns the first element of this list. | |
| const_reference | back () const |
| Returns the last element of this list. | |
| const_iterator | begin () const |
| Returns a C++ iterator pointing to the first element of this list. | |
| const_iterator | end () const |
| Returns a C++ iterator pointing beyond the last element of this list. | |
| auto | __iter__ () const |
| Returns a Python iterator over the elements of this list. | |
| bool | operator== (const ListView &) const=default |
| Determines whether this and the given list view are accessing the same underlying container. | |
A specialisation of ListView for working with lists stored in a C-style array whose size is not known at compile-time.
See the generic ListView class documentation for full details on how this class works and how to use it.
| Element | the type of element stored in the C-style array. This should not be a const type; the const modifier will added automatically where necessary through the class interface. |
| using regina::ListView< Element * >::const_iterator |
The iterator type for this list view.
Both iterator and const_iterator are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::const_iterator = const Element* |
The iterator type for this list view.
Both iterator and const_iterator are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::const_reference |
A reference to a list element.
Both reference and const_reference are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::const_reference = const Element& |
A reference to a list element.
Both reference and const_reference are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::iterator |
The iterator type for this list view.
Both iterator and const_iterator are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::iterator = const Element* |
The iterator type for this list view.
Both iterator and const_iterator are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::reference |
A reference to a list element.
Both reference and const_reference are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::reference = const Element& |
A reference to a list element.
Both reference and const_reference are the same, since this class only offers read-only access to the underlying list.
| using regina::ListView< Element * >::size_type |
The type used for indexing into this list.
| using regina::ListView< Element * >::size_type = size_t |
The type used for indexing into this list.
| using regina::ListView< Element * >::value_type |
The type of element that is stored in this list.
| using regina::ListView< Element * >::value_type = Element |
The type of element that is stored in this list.
|
inline |
Returns a view for the given C-style array, presented as an array with size.
Internally, this object will store a pointer to the array, which means the array needs to exist for at least as long as this object.
| array | the pointer to the C-style array. |
| size | the number of elements in the C-style array. |
|
inline |
Returns a view for the given C-style array, presented as an iterator pair.
Internally, this object will store a pointer to the array, which means the array needs to exist for at least as long as this object.
| begin | the beginning of the C-style array (that is, a pointer to the first element). |
| end | a pointer past the end of the C-style array (that is, a pointer immediately after the last element). |
|
default |
Creates a new copy of the given list view.
|
inline |
Returns a view for the given list.
| list | the list that this object will access. Internally, this object will store a reference to list (which means list needs to exist for at least as long as this object). |
|
default |
Creates a new copy of the given list view.
| auto regina::ListView< Element * >::__iter__ | ( | ) | const |
Returns a Python iterator over the elements of this list.
for loop.| auto regina::ListView< Element * >::__iter__ | ( | ) | const |
Returns a Python iterator over the elements of this list.
for loop.
|
inline |
Returns the last element of this list.
|
inline |
Returns the last element of this list.
|
inline |
Returns a C++ iterator pointing to the first element of this list.
The iterator range from begin() to end() runs through all the elements of this list in order from first to last.
|
inline |
Returns a C++ iterator pointing to the first element of this list.
|
inline |
Determines if this list is empty.
true if and only if this list is empty.
|
inline |
Determines if this list is empty.
true if and only if this list is empty.
|
inline |
Returns a C++ iterator pointing beyond the last element of this list.
The iterator range from begin() to end() runs through all the elements of this list in order from first to last.
|
inline |
Returns a C++ iterator pointing beyond the last element of this list.
|
inline |
Returns the first element of this list.
|
inline |
Returns the first element of this list.
|
default |
Sets this to be a copy of the given list view.
|
default |
Sets this to be a copy of the given list view.
|
default |
Determines whether this and the given list view are accessing the same underlying C-style array.
To be considered the same array, the two arrays must have the same location in memory (i.e., the pointers that define the C-style arrays must be equal), and the two arrays must have the same length. In particular, it is not enough for the two arrays just to have identical contents.
true if and only if this and the given list use the same underlying array.
|
default |
Determines whether this and the given list view are accessing the same underlying container.
Here the containers are compared by reference (i.e., they must be the same container object at the same location in memory; it is not enough to be two containers with identical contents).
true if and only if this and the given list use the same underlying container.
|
inline |
Returns the requested element of this list.
| index | indicates which element to return; this must be between 0 and size()-1 inclusive. |
|
inline |
Returns the requested element of this list.
| index | indicates which element to return; this must be between 0 and size()-1 inclusive. |
|
inline |
Returns the number of elements in this list.
|
inline |
Returns the number of elements in this list.