Base for lists with indirect addressing, templated on the list contents type and the addressing type. Storage for both values and addressing is held outside of the class. More...

Classes | |
| class | const_iterator |
| A const iterator for an indirect list. More... | |
| class | iterator |
| A non-const iterator for an indirect list. More... | |
Public Types | |
| typedef T | value_type |
| Type of values the list contains. More... | |
| typedef T * | pointer |
| The pointer type for non-const access to value_type items. More... | |
| typedef const T * | const_pointer |
| The pointer type for const access to value_type items. More... | |
| typedef T & | reference |
| The type used for storing into value_type objects. More... | |
| typedef const T & | const_reference |
| The type used for reading from constant value_type objects. More... | |
| typedef label | size_type |
| The type to represent the size of a UList. More... | |
| typedef label | difference_type |
| The difference between iterator objects. More... | |
| typedef Addr | addressing_type |
| The addressing type (non-stl definition) More... | |
Public Member Functions | |
| IndirectListBase ()=delete | |
| No default construct. More... | |
| IndirectListBase (const UList< T > &values, const Addr &addr) noexcept | |
| Store references to the values list and the addressing array. More... | |
| template<class... Args> | |
| IndirectListBase (UList< T > &&, Args &&...)=delete | |
| The values list (reference) cannot be an rvalue! More... | |
| IndirectListBase (const UList< T > &, Addr &&)=delete | |
| The addressing (reference) cannot be an rvalue! More... | |
| bool | empty () const noexcept |
| True if the list is empty (ie, size() is zero). More... | |
| label | size () const noexcept |
| The number of elements in the list. More... | |
| const UList< T > & | values () const noexcept |
| The list of values (without addressing) More... | |
| UList< T > & | values () noexcept |
| The list of values (without addressing) More... | |
| const Addr & | addressing () const noexcept |
| The addressing used for the list. More... | |
| bool | uniform () const |
| True if all entries have identical values, and list is non-empty. More... | |
| const T & | front () const |
| The first element of the list. More... | |
| T & | front () |
| The first element of the list. More... | |
| const T & | back () const |
| The last element of the list. More... | |
| T & | back () |
| The last element of the list. More... | |
| label | fcIndex (const label i) const noexcept |
| The forward circular index. The next index in the list which returns to the first at the end of the list. More... | |
| label | rcIndex (const label i) const noexcept |
| The reverse circular index. The previous index in the list which returns to the last at the beginning of the list. More... | |
| const T & | fcValue (const label i) const |
| Return forward circular value (ie, next value in the list) More... | |
| T & | fcValue (const label i) |
| Return forward circular value (ie, next value in the list) More... | |
| const T & | rcValue (const label i) const |
| Return reverse circular value (ie, previous value in the list) More... | |
| T & | rcValue (const label i) |
| Return reverse circular value (ie, previous value in the list) More... | |
| void | extract (UList< T > &result) const |
| Extract the addressed elements. Sizes must match! More... | |
| List< T > | list () const |
| Extract and return the addressed elements as a List. More... | |
| void | checkAddressing () const |
| Check that addressing is within valid range of values(), otherwise Fatal. More... | |
| bool | contains (const T &val, label pos=0, label len=-1) const |
| Is the value contained in the list? More... | |
| label | find (const T &val, label pos=0, label len=-1) const |
| Find index of the first occurrence of the value. More... | |
| label | rfind (const T &val, label pos=-1) const |
| Find index of the last occurrence of the value. More... | |
| List< T > | operator() () const |
| Extract and return the addressed elements as a List. Same as the list() method. More... | |
| T & | operator[] (const label i) |
| Non-const access to an element in the list. More... | |
| const T & | operator[] (const label i) const |
| Const access to an element in the list. More... | |
| void | operator= (const T &val) |
| Assign all addressed elements to the given value. More... | |
| void | operator= (Foam::zero) |
| Assignment of all entries to zero. More... | |
| void | operator= (const UList< T > &rhs) |
| Deep copy values from a list of the addressed elements. More... | |
| void | operator= (const IndirectListBase &rhs) |
| Deep copy values from a list of the addressed elements. More... | |
| template<class AnyAddr > | |
| void | operator= (const IndirectListBase< T, AnyAddr > &rhs) |
| Deep copy values from a list of the addressed elements. More... | |
| iterator | begin () |
| Return an iterator at begin of list. More... | |
| iterator | end () |
| Return an iterator at end of list. More... | |
| const_iterator | cbegin () const |
| Return a const_iterator at begin of list. More... | |
| const_iterator | cend () const |
| Return a const_iterator at end of list. More... | |
| const_iterator | begin () const |
| Return a const_iterator at begin of list. More... | |
| const_iterator | end () const |
| Return a const_iterator at end of list. More... | |
| Ostream & | writeList (Ostream &os, const label shortLen=0) const |
| Write List, with line-breaks in ASCII when length exceeds shortLen. More... | |
| T & | first () |
| Access first element of the list, position [0]. More... | |
| const T & | first () const |
| Access first element of the list. More... | |
| T & | last () |
| Access last element of the list, position [size()-1]. More... | |
| const T & | last () const |
| Access last element of the list, position [size()-1]. More... | |
| bool | found (const T &val, label pos=0) const |
| Same as contains() More... | |
Base for lists with indirect addressing, templated on the list contents type and the addressing type. Storage for both values and addressing is held outside of the class.
Definition at line 115 of file IndirectListBase.H.
| typedef T value_type |
Type of values the list contains.
Definition at line 147 of file IndirectListBase.H.
The pointer type for non-const access to value_type items.
Definition at line 152 of file IndirectListBase.H.
| typedef const T* const_pointer |
The pointer type for const access to value_type items.
Definition at line 157 of file IndirectListBase.H.
The type used for storing into value_type objects.
Definition at line 162 of file IndirectListBase.H.
| typedef const T& const_reference |
The type used for reading from constant value_type objects.
Definition at line 167 of file IndirectListBase.H.
| typedef label size_type |
The type to represent the size of a UList.
Definition at line 172 of file IndirectListBase.H.
| typedef label difference_type |
The difference between iterator objects.
Definition at line 177 of file IndirectListBase.H.
| typedef Addr addressing_type |
The addressing type (non-stl definition)
Definition at line 187 of file IndirectListBase.H.
|
delete |
No default construct.
|
inlinenoexcept |
Store references to the values list and the addressing array.
Definition at line 69 of file IndirectListBaseI.H.
|
delete |
The values list (reference) cannot be an rvalue!
|
delete |
The addressing (reference) cannot be an rvalue!
|
inlinenoexcept |
True if the list is empty (ie, size() is zero).
Definition at line 236 of file IndirectListBase.H.
Referenced by List< Field< scalar > >::List().

|
inlinenoexcept |
The number of elements in the list.
Definition at line 241 of file IndirectListBase.H.
Referenced by UList< Foam::vector >::deepCopy(), List< Field< scalar > >::List(), List< Field< scalar > >::operator=(), PackedList< 2 >::PackedList(), List< Field< scalar > >::push_back(), DynamicList< Foam::vector >::push_back(), LLTMatrix< Type >::solve(), and IndirectListBase< T, labelRange >::writeList().

The list of values (without addressing)
Definition at line 246 of file IndirectListBase.H.
The list of values (without addressing)
Definition at line 251 of file IndirectListBase.H.
|
inlinenoexcept |
The addressing used for the list.
Definition at line 256 of file IndirectListBase.H.
|
inline |
True if all entries have identical values, and list is non-empty.
Definition at line 82 of file IndirectListBaseI.H.
Referenced by IndirectListBase< T, labelRange >::writeList().

|
inline |
The first element of the list.
Definition at line 134 of file IndirectListBaseI.H.
Referenced by IndirectListBase< T, labelRange >::first().

|
inline |
The first element of the list.
Definition at line 140 of file IndirectListBaseI.H.
|
inline |
The last element of the list.
Definition at line 147 of file IndirectListBaseI.H.
Referenced by IndirectListBase< T, labelRange >::last().

|
inline |
The last element of the list.
Definition at line 153 of file IndirectListBaseI.H.
|
inlinenoexcept |
The forward circular index. The next index in the list which returns to the first at the end of the list.
Definition at line 119 of file IndirectListBaseI.H.
|
inlinenoexcept |
The reverse circular index. The previous index in the list which returns to the last at the beginning of the list.
Definition at line 127 of file IndirectListBaseI.H.
|
inline |
Return forward circular value (ie, next value in the list)
Definition at line 160 of file IndirectListBaseI.H.
|
inline |
Return forward circular value (ie, next value in the list)
Definition at line 167 of file IndirectListBaseI.H.
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 174 of file IndirectListBaseI.H.
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 181 of file IndirectListBaseI.H.
Extract the addressed elements. Sizes must match!
Definition at line 188 of file IndirectListBaseI.H.
|
inline |
Extract and return the addressed elements as a List.
Definition at line 358 of file IndirectListBaseI.H.
|
inline |
Check that addressing is within valid range of values(), otherwise Fatal.
Definition at line 219 of file IndirectListBaseI.H.
|
inline |
Is the value contained in the list?
| val | The value to search for |
| pos | The first position to examine (default: 0, no-op if -ve) |
| len | The length of the search region (-ve until the end) |
Definition at line 107 of file IndirectListBaseI.H.
Referenced by IndirectListBase< T, labelRange >::found().

| Foam::label find | ( | const T & | val, |
| label | pos = 0, |
||
| label | len = -1 |
||
| ) | const |
Find index of the first occurrence of the value.
| val | The value to search for |
| pos | The first position to examine (default: 0, no-op if -ve) |
| len | The length of the search region (-ve until the end) |
Definition at line 25 of file IndirectListBase.C.
Referenced by pureZoneMixture< ThermoType >::pureZoneMixture().

| Foam::label rfind | ( | const T & | val, |
| label | pos = -1 |
||
| ) | const |
Find index of the last occurrence of the value.
Any occurrences after the end pos are ignored. Linear search.
Definition at line 61 of file IndirectListBase.C.
|
inline |
Extract and return the addressed elements as a List. Same as the list() method.
Definition at line 367 of file IndirectListBaseI.H.
|
inline |
Non-const access to an element in the list.
Definition at line 256 of file IndirectListBaseI.H.
|
inline |
Const access to an element in the list.
Definition at line 264 of file IndirectListBaseI.H.
|
inline |
Assign all addressed elements to the given value.
Definition at line 271 of file IndirectListBaseI.H.
|
inline |
Assignment of all entries to zero.
Definition at line 281 of file IndirectListBaseI.H.
Deep copy values from a list of the addressed elements.
Fatal if list sizes are not identical
Definition at line 292 of file IndirectListBaseI.H.
|
inline |
Deep copy values from a list of the addressed elements.
Fatal if list sizes are not identical
Definition at line 312 of file IndirectListBaseI.H.
|
inline |
Deep copy values from a list of the addressed elements.
Fatal if list sizes are not identical
Definition at line 333 of file IndirectListBaseI.H.
|
inline |
Return an iterator at begin of list.
Definition at line 530 of file IndirectListBase.H.
Referenced by bitSet::bitSet(), HashSet< word, Hash< word > >::HashSet(), HashSet< word, Hash< word > >::insert(), DynamicList< Foam::vector >::push_back(), bitSet::set(), CompactListList< T >::unpack(), HashSet< word, Hash< word > >::unset(), and bitSet::unset().

|
inline |
Return an iterator at end of list.
Definition at line 538 of file IndirectListBase.H.
Referenced by bitSet::bitSet(), HashSet< word, Hash< word > >::HashSet(), HashSet< word, Hash< word > >::insert(), DynamicList< Foam::vector >::push_back(), bitSet::set(), HashSet< word, Hash< word > >::unset(), and bitSet::unset().

|
inline |
Return a const_iterator at begin of list.
Definition at line 549 of file IndirectListBase.H.
Referenced by IndirectListBase< T, labelRange >::begin().

|
inline |
Return a const_iterator at end of list.
Definition at line 557 of file IndirectListBase.H.
Referenced by IndirectListBase< T, labelRange >::end().

|
inline |
Return a const_iterator at begin of list.
Definition at line 565 of file IndirectListBase.H.
|
inline |
Return a const_iterator at end of list.
Definition at line 570 of file IndirectListBase.H.
| Foam::Ostream & writeList | ( | Ostream & | os, |
| const label | shortLen = 0 |
||
| ) | const |
Write List, with line-breaks in ASCII when length exceeds shortLen.
Using '0' suppresses line-breaks entirely.
Definition at line 30 of file IndirectListBaseIO.C.
|
inline |
Access first element of the list, position [0].
FOAM_DEPRECATED_FOR(2022-10, "front()")
Definition at line 590 of file IndirectListBase.H.
|
inline |
Access first element of the list.
FOAM_DEPRECATED_FOR(2022-10, "front()")
Definition at line 597 of file IndirectListBase.H.
|
inline |
Access last element of the list, position [size()-1].
FOAM_DEPRECATED_FOR(2022-10, "back()")
Definition at line 604 of file IndirectListBase.H.
|
inline |
Access last element of the list, position [size()-1].
FOAM_DEPRECATED_FOR(2022-10, "back()")
Definition at line 611 of file IndirectListBase.H.
|
inline |
Same as contains()
Definition at line 616 of file IndirectListBase.H.