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) | |
Store references to the values list and the addressing array. More... | |
label | size () const noexcept |
The number of elements in the list. More... | |
bool | empty () const noexcept |
True if the list is empty (ie, size() is zero). 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 & | first () const |
The first element of the list. More... | |
T & | first () |
The first element of the list. More... | |
const T & | last () const |
The last element of the list. More... | |
T & | last () |
The last element of the list. More... | |
label | fcIndex (const label i) const |
label | rcIndex (const label i) const |
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... | |
label | find (const T &val, label pos=0) 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... | |
bool | found (const T &val, label pos=0) const |
True if the value if found in the list. More... | |
List< T > | operator() () const |
Return the addressed elements as a List. 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= (const 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< T, Addr > &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... | |
Protected Member Functions | |
template<class ListType > | |
void | copyList (const ListType &rhs) |
Deep copy values from the list. 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 56 of file IndirectListBase.H.
typedef T value_type |
Type of values the list contains.
Definition at line 81 of file IndirectListBase.H.
The pointer type for non-const access to value_type items.
Definition at line 84 of file IndirectListBase.H.
typedef const T* const_pointer |
The pointer type for const access to value_type items.
Definition at line 87 of file IndirectListBase.H.
The type used for storing into value_type objects.
Definition at line 90 of file IndirectListBase.H.
typedef const T& const_reference |
The type used for reading from constant value_type objects.
Definition at line 93 of file IndirectListBase.H.
typedef label size_type |
The type to represent the size of a UList.
Definition at line 96 of file IndirectListBase.H.
typedef label difference_type |
The difference between iterator objects.
Definition at line 99 of file IndirectListBase.H.
typedef Addr addressing_type |
The addressing type (non-stl definition)
Definition at line 108 of file IndirectListBase.H.
|
delete |
No default construct.
|
inline |
Store references to the values list and the addressing array.
Definition at line 64 of file IndirectListBaseI.H.
|
inlineprotected |
Deep copy values from the list.
Definition at line 32 of file IndirectListBaseI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.
|
inlinenoexcept |
The number of elements in the list.
Definition at line 125 of file IndirectListBase.H.
Referenced by CircularBuffer< T >::append(), List< T >::append(), DynamicList< T, SizeMin >::append(), bitSet::bitSet(), UList< T >::deepCopy(), globalIndex::gatherOp(), Foam::ensightOutput::Detail::getFaceSizes(), List< T >::operator=(), PackedList< Width >::PackedList(), LLTMatrix< Type >::solve(), Foam::ListListOps::subSizes(), and IndirectListBase< T, Addr >::writeList().
|
inlinenoexcept |
True if the list is empty (ie, size() is zero).
Definition at line 131 of file IndirectListBase.H.
The list of values (without addressing)
Definition at line 137 of file IndirectListBase.H.
The list of values (without addressing)
Definition at line 143 of file IndirectListBase.H.
|
inlinenoexcept |
The addressing used for the list.
Definition at line 149 of file IndirectListBase.H.
True if all entries have identical values, and list is non-empty.
Definition at line 78 of file IndirectListBaseI.H.
References T.
Referenced by IndirectListBase< T, Addr >::writeList().
|
inline |
The first element of the list.
Definition at line 127 of file IndirectListBaseI.H.
Referenced by DarcyForchheimer::calcTransformModelData().
|
inline |
The first element of the list.
Definition at line 133 of file IndirectListBaseI.H.
|
inline |
The last element of the list.
Definition at line 140 of file IndirectListBaseI.H.
Referenced by SprayCloud< CloudType >::penetration().
|
inline |
The last element of the list.
Definition at line 146 of file IndirectListBaseI.H.
|
inline |
The forward circular index. The next index in the list which returns to the first at the end of the list
Definition at line 113 of file IndirectListBaseI.H.
Referenced by CircularBuffer< T >::append().
|
inline |
The reverse circular index. The previous index in the list which returns to the last at the beginning of the list
Definition at line 120 of file IndirectListBaseI.H.
|
inline |
Return forward circular value (ie, next value in the list)
Definition at line 153 of file IndirectListBaseI.H.
Referenced by face::nextLabel().
|
inline |
Return forward circular value (ie, next value in the list)
Definition at line 160 of file IndirectListBaseI.H.
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 167 of file IndirectListBaseI.H.
Referenced by face::prevLabel().
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 174 of file IndirectListBaseI.H.
Foam::label find | ( | const T & | val, |
label | pos = 0 |
||
) | const |
Find index of the first occurrence of the value.
Any occurrences before the start pos are ignored. Linear search.
Definition at line 31 of file IndirectListBase.C.
References List_CONST_ACCESS, Foam::pos(), and T.
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 59 of file IndirectListBase.C.
References List_CONST_ACCESS, Foam::pos(), and T.
True if the value if found in the list.
Any occurrences before the start pos are ignored. Linear search.
Definition at line 102 of file IndirectListBaseI.H.
References Foam::pos().
|
inline |
Return the addressed elements as a List.
Definition at line 184 of file IndirectListBaseI.H.
|
inline |
Non-const access to an element in the list.
Definition at line 201 of file IndirectListBaseI.H.
|
inline |
Const access to an element in the list.
Definition at line 209 of file IndirectListBaseI.H.
|
inline |
Assign all addressed elements to the given value.
Definition at line 216 of file IndirectListBaseI.H.
|
inline |
Assignment of all entries to zero.
Definition at line 227 of file IndirectListBaseI.H.
Deep copy values from a list of the addressed elements.
Fatal if list sizes are not identical
Definition at line 238 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 248 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 259 of file IndirectListBaseI.H.
|
inline |
Return an iterator at begin of list.
Definition at line 338 of file IndirectListBase.H.
References UList< T >::cbegin().
Referenced by bitSet::bitSet(), HashSet< labelPairPair >::HashSet(), HashSet< Key, Hash >::HashSet(), HashSet< labelPairPair >::insert(), bitSet::set(), and bitSet::unset().
|
inline |
Return an iterator at end of list.
Definition at line 344 of file IndirectListBase.H.
References UList< T >::cend().
Referenced by bitSet::bitSet(), HashSet< labelPairPair >::HashSet(), HashSet< Key, Hash >::HashSet(), HashSet< labelPairPair >::insert(), bitSet::set(), and bitSet::unset().
|
inline |
Return a const_iterator at begin of list.
Definition at line 353 of file IndirectListBase.H.
References UList< T >::cbegin().
Referenced by IndirectListBase< T, Addr >::begin().
|
inline |
Return a const_iterator at end of list.
Definition at line 359 of file IndirectListBase.H.
References UList< T >::cend().
Referenced by IndirectListBase< T, Addr >::end().
|
inline |
Return a const_iterator at begin of list.
Definition at line 365 of file IndirectListBase.H.
References IndirectListBase< T, Addr >::cbegin().
|
inline |
Return a const_iterator at end of list.
Definition at line 368 of file IndirectListBase.H.
References IndirectListBase< T, Addr >::cend().
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 37 of file IndirectListBaseIO.C.
References FUNCTION_NAME, Foam::nl, os(), IndirectListBase< T, Addr >::size(), T, and IndirectListBase< T, Addr >::uniform().
Referenced by Foam::operator<<().