Indirect access to a sub-section of a list. More...
#include <IndirectSubList.H>


Public Member Functions | |
| IndirectSubList (const UList< T > &values) | |
| Construct from UList, the entire size. | |
| IndirectSubList (const UList< T > &values, const labelRange &addr) | |
| Construct from values list and range. | |
| const Addr & | addressing () const noexcept |
| The list addressing. | |
| Addr & | addressing () noexcept |
| The list addressing. | |
| Public Member Functions inherited from IndirectListBase< T, labelRange > | |
| IndirectListBase ()=delete | |
| No default construct. | |
| bool | empty () const noexcept |
| True if the list is empty (ie, size() is zero). | |
| label | size () const noexcept |
| The number of elements in the list. | |
| const UList< T > & | values () const noexcept |
| The list of values (without addressing). | |
| const labelRange & | addressing () const noexcept |
| The addressing used for the list. | |
| bool | uniform () const |
| True if all entries have identical values, and list is non-empty. | |
| const T & | front () const |
| The first element of the list. | |
| const T & | back () const |
| The last element of the list. | |
| label | fcIndex (const label i) const |
| The forward circular index. The next index in the list which returns to the first at the end of the list. | |
| label | rcIndex (const label i) const |
| The reverse circular index. The previous index in the list which returns to the last at the beginning of the list. | |
| const T & | fcValue (const label i) const |
| Return forward circular value (ie, next value in the list). | |
| const T & | rcValue (const label i) const |
| Return reverse circular value (ie, previous value in the list). | |
| List< T > | list () const |
| Return the addressed elements as a List. | |
| bool | contains (const T &val, label pos=0, label len=-1) const |
| Is the value contained in the list? | |
| label | find (const T &val, label pos=0, label len=-1) const |
| Find index of the first occurrence of the value. | |
| label | rfind (const T &val, label pos=-1) const |
| Find index of the last occurrence of the value. | |
| List< T > | operator() () const |
| Return the addressed elements as a List. | |
| T & | operator[] (const label i) |
| Non-const access to an element in the list. | |
| void | operator= (const T &val) |
| Assign all addressed elements to the given value. | |
| iterator | begin () |
| Return an iterator at begin of list. | |
| iterator | end () |
| Return an iterator at end of list. | |
| const_iterator | cbegin () const |
| Return a const_iterator at begin of list. | |
| const_iterator | cend () const |
| Return a const_iterator at end of list. | |
| Ostream & | writeList (Ostream &os, const label shortLen=0) const |
| Write List, with line-breaks in ASCII when length exceeds shortLen. | |
| T & | first () |
| Access first element of the list, position [0]. | |
| T & | last () |
| Access last element of the list, position [size()-1]. | |
| bool | found (const T &val, label pos=0) const |
| Same as contains(). | |
Additional Inherited Members | |
| Public Types inherited from IndirectListBase< T, labelRange > | |
| typedef T | value_type |
| Type of values the list contains. | |
| typedef T * | pointer |
| The pointer type for non-const access to value_type items. | |
| typedef const T * | const_pointer |
| The pointer type for const access to value_type items. | |
| typedef T & | reference |
| The type used for storing into value_type objects. | |
| typedef const T & | const_reference |
| The type used for reading from constant value_type objects. | |
| typedef label | size_type |
| The type to represent the size of a UList. | |
| typedef label | difference_type |
| The difference between iterator objects. | |
| typedef labelRange | addressing_type |
| The addressing type (non-stl definition). | |
| Protected Member Functions inherited from IndirectListBase< T, labelRange > | |
| void | copyList (const ListType &rhs) |
| Deep copy values from the list. | |
Indirect access to a sub-section of a list.
In many cases, using a Foam::SubList provides a simpler and more efficient means of accessing a sub-list. There are, however, some advantages of a IndirectSubList:
Definition at line 56 of file IndirectSubList.H.
Construct from UList, the entire size.
Definition at line 68 of file IndirectSubList.H.
References addressing(), IndirectListAddressing< labelRange >::IndirectListAddressing(), IndirectListBase< T, labelRange >::IndirectListBase(), IndirectListBase< T, labelRange >::size(), Foam::T(), and IndirectListBase< T, labelRange >::values().

|
inline |
Construct from values list and range.
Definition at line 81 of file IndirectSubList.H.
References addressing(), IndirectListAddressing< labelRange >::IndirectListAddressing(), IndirectListBase< T, labelRange >::IndirectListBase(), Foam::T(), and IndirectListBase< T, labelRange >::values().

|
inlinenoexcept |
The list addressing.
Definition at line 80 of file IndirectListAddressing.H.
Referenced by IndirectSubList(), and IndirectSubList().

|
inlinenoexcept |
The list addressing.
Definition at line 88 of file IndirectListAddressing.H.