A 1D vector of objects of type <T> with a fixed length <N>. More...
Classes | |
struct | Hash |
Hashing function class for FixedList. More... | |
Public Types | |
typedef T | value_type |
The value type the FixedList contains. More... | |
typedef T * | pointer |
The pointer type for non-const access to value_type items. More... | |
typedef T & | reference |
The type used for storing into value_type objects. More... | |
typedef T * | iterator |
Random access iterator for traversing FixedList. More... | |
typedef label | size_type |
The type to represent the size of a FixedList. More... | |
typedef label | difference_type |
The difference between iterator objects. More... | |
typedef std::reverse_iterator< iterator > | reverse_iterator |
Reverse iterator (non-const access) More... | |
typedef std::reverse_iterator< const_iterator > | const_reverse_iterator |
Reverse iterator (const access) More... | |
Public Member Functions | |
FixedList ()=default | |
Default construct. More... | |
FixedList (const T &val) | |
Construct and initialize all entries to given value. More... | |
FixedList (const zero) | |
Construct and initialize all entries to zero. More... | |
FixedList (const T list[N]) | |
Copy construct from C-array. More... | |
FixedList (const FixedList< T, N > &list) | |
Copy construct. More... | |
FixedList (FixedList< T, N > &&list) | |
template<class InputIterator > | |
FixedList (InputIterator begIter, InputIterator endIter) | |
Construct given begin/end iterators. More... | |
FixedList (std::initializer_list< T > list) | |
Construct from an initializer list. More... | |
FixedList (const UList< T > &list) | |
Construct from UList. More... | |
FixedList (const UList< T > &list, const FixedList< label, N > &indices) | |
Copy construct from a subset of the input. More... | |
FixedList (const SLList< T > &list) | |
Construct from SLList. More... | |
FixedList (Istream &is) | |
Construct from Istream. More... | |
autoPtr< FixedList< T, N > > | clone () const |
Clone. More... | |
const T * | cdata () const noexcept |
Return a const pointer to the first data element. More... | |
T * | data () noexcept |
Return a pointer to the first data element. More... | |
T & | first () noexcept |
The first element of the list, position [0]. More... | |
const T & | first () const noexcept |
The first element of the list, position [0]. More... | |
T & | last () noexcept |
The last element of the list, position [N-1]. More... | |
const T & | last () const noexcept |
The last element of the list, position [N-1]. More... | |
label | fcIndex (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... | |
label | rcIndex (const label i) const |
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 | checkStart (const label start) const |
Check start is within valid range [0,size) More... | |
void | checkSize (const label size) const |
Check size is identical to template parameter N. More... | |
void | checkIndex (const label i) const |
Check index is within valid range [0,N) More... | |
bool | uniform () const |
True if all entries have identical values, and list is non-empty. 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... | |
void | resize (const label n) |
Dummy resize function, to make FixedList consistent with List. More... | |
void | setSize (const label n) |
Dummy setSize function, to make FixedList consistent with List. More... | |
void | moveFirst (const label i) |
Move element to the first position. More... | |
void | moveLast (const label i) |
Move element to the last position. More... | |
void | swapFirst (const label i) |
Swap element with the first element. More... | |
void | swapLast (const label i) |
Swap element with the last element. More... | |
void | transfer (FixedList< T, N > &list) |
T & | operator[] (const label i) |
Return element of FixedList. More... | |
const T & | operator[] (const label i) const |
Return element of constant FixedList. More... | |
void | operator= (const T list[N]) |
Assignment to array operator. Takes linear time. More... | |
void | operator= (const UList< T > &list) |
Assignment to UList operator. Takes linear time. More... | |
void | operator= (const SLList< T > &list) |
Assignment to SLList operator. Takes linear time. More... | |
void | operator= (std::initializer_list< T > list) |
Assignment to an initializer list. Takes linear time. More... | |
void | operator= (const T &val) |
Assignment of all entries to the given value. More... | |
void | operator= (const FixedList< T, N > &list) |
Copy assignment. More... | |
void | operator= (FixedList< T, N > &&list) |
Move assignment. More... | |
iterator | begin () |
Return an iterator to begin traversing the FixedList. More... | |
iterator | end () |
Return an iterator to end traversing the FixedList. More... | |
const_iterator | cbegin () const |
Return const_iterator to begin traversing the constant FixedList. More... | |
const_iterator | cend () const |
Return const_iterator to end traversing the constant FixedList. More... | |
const_iterator | begin () const |
Return const_iterator to begin traversing the constant FixedList. More... | |
const_iterator | end () const |
Return const_iterator to end traversing the constant FixedList. More... | |
reverse_iterator | rbegin () |
Return reverse_iterator to begin reverse traversing the FixedList. More... | |
reverse_iterator | rend () |
Return reverse_iterator to end reverse traversing the FixedList. More... | |
const_reverse_iterator | crbegin () const |
Return const_reverse_iterator to begin reverse traversing FixedList. More... | |
const_reverse_iterator | crend () const |
Return const_reverse_iterator to end reverse traversing FixedList. More... | |
const_reverse_iterator | rbegin () const |
Return const_reverse_iterator to begin reverse traversing FixedList. More... | |
const_reverse_iterator | rend () const |
Return const_reverse_iterator to end reverse traversing FixedList. More... | |
void | swap (FixedList< T, N > &list) |
Swap lists by swapping the content of the individual list elements. More... | |
bool | operator== (const FixedList< T, N > &list) const |
Equality operation on FixedLists of the same type. More... | |
bool | operator!= (const FixedList< T, N > &list) const |
The opposite of the equality operation. Takes linear time. More... | |
bool | operator< (const FixedList< T, N > &list) const |
Compare two FixedLists lexicographically. Takes linear time. More... | |
bool | operator> (const FixedList< T, N > &list) const |
Compare two FixedLists lexicographically. Takes linear time. More... | |
bool | operator<= (const FixedList< T, N > &list) const |
Return true if !(a > b). Takes linear time. More... | |
bool | operator>= (const FixedList< T, N > &list) const |
Return true if !(a < b). Takes linear time. More... | |
void | writeEntry (const word &keyword, Ostream &os) const |
Write the list as a dictionary entry with keyword. More... | |
Ostream & | writeList (Ostream &os, const label shortLen=0) const |
Write List, with line-breaks in ASCII when length exceeds shortLen. More... | |
Static Public Member Functions | |
static const FixedList< T, N > & | null () |
Return a null FixedList. More... | |
static constexpr bool | empty () noexcept |
Always false since zero-sized FixedList is compile-time disabled. More... | |
static constexpr label | size () noexcept |
Return the number of elements in the FixedList. More... | |
static constexpr unsigned | max_size () noexcept |
The dimensioned size (template parameter N) of the FixedList. More... | |
Public Attributes | |
const typedef T * | const_pointer |
The pointer type for const access to value_type items. More... | |
const typedef T & | const_reference |
The type used for reading from constant value_type objects. More... | |
const typedef T * | const_iterator |
Random access iterator for traversing FixedList. More... | |
Protected Member Functions | |
void | writeEntry (Ostream &os) const |
Write the FixedList with its compound type. More... | |
Friends | |
Istream & | operator>> (Istream &is, FixedList< T, N > &list) |
Read from Istream, discarding contents of existing List. More... | |
A 1D vector of objects of type <T> with a fixed length <N>.
Definition at line 104 of file HashTable.H.
typedef T value_type |
The value type the FixedList contains.
Definition at line 104 of file FixedList.H.
The pointer type for non-const access to value_type items.
Definition at line 107 of file FixedList.H.
The type used for storing into value_type objects.
Definition at line 113 of file FixedList.H.
Random access iterator for traversing FixedList.
Definition at line 119 of file FixedList.H.
typedef label size_type |
The type to represent the size of a FixedList.
Definition at line 125 of file FixedList.H.
typedef label difference_type |
The difference between iterator objects.
Definition at line 128 of file FixedList.H.
typedef std::reverse_iterator<iterator> reverse_iterator |
Reverse iterator (non-const access)
Definition at line 131 of file FixedList.H.
typedef std::reverse_iterator<const_iterator> const_reverse_iterator |
Reverse iterator (const access)
Definition at line 134 of file FixedList.H.
|
default |
Default construct.
Construct and initialize all entries to given value.
Definition at line 46 of file FixedListI.H.
|
inlineexplicit |
Construct and initialize all entries to zero.
Definition at line 56 of file FixedListI.H.
Copy construct from C-array.
Definition at line 66 of file FixedListI.H.
Copy construct.
Definition at line 76 of file FixedListI.H.
Move construct by using move assignment for the individual list elements
Definition at line 86 of file FixedListI.H.
|
inline |
Construct given begin/end iterators.
Uses std::distance when verifying the size.
Definition at line 98 of file FixedListI.H.
Construct from an initializer list.
Definition at line 114 of file FixedListI.H.
Construct from UList.
Definition at line 128 of file FixedListI.H.
Copy construct from a subset of the input.
Definition at line 141 of file FixedListI.H.
Construct from SLList.
Definition at line 154 of file FixedListI.H.
Construct from Istream.
Definition at line 141 of file FixedListIO.C.
|
protected |
Write the FixedList with its compound type.
Definition at line 37 of file FixedListIO.C.
|
inlinestatic |
Return a null FixedList.
Definition at line 37 of file FixedListI.H.
|
inline |
Clone.
Definition at line 169 of file FixedListI.H.
|
inlinenoexcept |
Return a const pointer to the first data element.
Similar to the STL front() method and the string::data() method This can be used (with caution) when interfacing with C code
Definition at line 179 of file FixedListI.H.
Referenced by FixedList< Type, 3 >::writeList().
Return a pointer to the first data element.
Similar to the STL front() method and the string::data() method This can be used (with caution) when interfacing with C code
Definition at line 187 of file FixedListI.H.
|
inlinenoexcept |
The first element of the list, position [0].
Definition at line 194 of file FixedListI.H.
Referenced by parProfiling::report(), and LangmuirHinshelwoodReactionRate::write().
|
inlinenoexcept |
The first element of the list, position [0].
Definition at line 201 of file FixedListI.H.
|
inlinenoexcept |
The last element of the list, position [N-1].
Definition at line 208 of file FixedListI.H.
|
inlinenoexcept |
The last element of the list, position [N-1].
Definition at line 215 of file FixedListI.H.
|
inline |
Return the forward circular index, i.e. next index which returns to the first at the end of the list
Definition at line 222 of file FixedListI.H.
Referenced by wallBoundedParticle::isTriAlongTrack(), and wallBoundedParticle::trackFaceTri().
|
inline |
Return forward circular value (ie, next value in the list)
Definition at line 229 of file FixedListI.H.
|
inline |
Return forward circular value (ie, next value in the list)
Definition at line 236 of file FixedListI.H.
|
inline |
Return the reverse circular index, i.e. previous index which returns to the last at the beginning of the list
Definition at line 243 of file FixedListI.H.
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 250 of file FixedListI.H.
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 257 of file FixedListI.H.
|
inline |
Check start is within valid range [0,size)
Definition at line 264 of file FixedListI.H.
|
inline |
Check size is identical to template parameter N.
Definition at line 277 of file FixedListI.H.
|
inline |
Check index is within valid range [0,N)
Definition at line 289 of file FixedListI.H.
True if all entries have identical values, and list is non-empty.
Definition at line 301 of file FixedListI.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 35 of file FixedList.C.
Referenced by triFace::which().
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 57 of file FixedList.C.
True if the value if found in the list.
Any occurrences before the start pos are ignored. Linear search.
Definition at line 319 of file FixedListI.H.
Referenced by triFace::found().
|
inline |
Dummy resize function, to make FixedList consistent with List.
Definition at line 329 of file FixedListI.H.
|
inline |
Dummy setSize function, to make FixedList consistent with List.
Definition at line 337 of file FixedListI.H.
Referenced by triSurfaceTools::collapseEdges(), blockDescriptor::facePoints(), shellSurfaces::findHigherGapLevel(), triSurfaceTools::mergePoints(), refinementHistory::refinementHistory(), refinementSurfaces::refinementSurfaces(), and shellSurfaces::shellSurfaces().
void moveFirst | ( | const label | i | ) |
Move element to the first position.
Definition at line 82 of file FixedList.C.
void moveLast | ( | const label | i | ) |
Move element to the last position.
Definition at line 94 of file FixedList.C.
void swapFirst | ( | const label | i | ) |
Swap element with the first element.
Definition at line 106 of file FixedList.C.
void swapLast | ( | const label | i | ) |
Swap element with the last element.
Definition at line 118 of file FixedList.C.
Transfer by swapping using a move assignment for the content of the individual list elements
Definition at line 361 of file FixedListI.H.
|
inline |
Return element of FixedList.
Definition at line 378 of file FixedListI.H.
|
inline |
Return element of constant FixedList.
Definition at line 388 of file FixedListI.H.
|
inline |
Assignment to array operator. Takes linear time.
Definition at line 398 of file FixedListI.H.
Referenced by boolVector::operator=().
Assignment to UList operator. Takes linear time.
Definition at line 407 of file FixedListI.H.
Assignment to SLList operator. Takes linear time.
Definition at line 418 of file FixedListI.H.
|
inline |
Assignment to an initializer list. Takes linear time.
Definition at line 431 of file FixedListI.H.
|
inline |
Assignment of all entries to the given value.
Definition at line 444 of file FixedListI.H.
Copy assignment.
Definition at line 453 of file FixedListI.H.
Move assignment.
Definition at line 467 of file FixedListI.H.
|
inline |
Return an iterator to begin traversing the FixedList.
Definition at line 487 of file FixedListI.H.
Referenced by bitSet::bitSet(), edge::erase(), HashSet< Foam::string >::insert(), edge::insert(), Foam::operator*(), Foam::operator/(), HashSet< Foam::string >::operator=(), bitSet::set(), bitSet::unset(), and HashSet< Foam::string >::unset().
|
inline |
Return an iterator to end traversing the FixedList.
Definition at line 511 of file FixedListI.H.
Referenced by bitSet::bitSet(), edge::erase(), HashSet< Foam::string >::insert(), edge::insert(), HashSet< Foam::string >::operator=(), bitSet::set(), bitSet::unset(), and HashSet< Foam::string >::unset().
|
inline |
Return const_iterator to begin traversing the constant FixedList.
Definition at line 503 of file FixedListI.H.
Referenced by HashTable< Foam::phase * >::erase().
|
inline |
Return const_iterator to end traversing the constant FixedList.
Definition at line 527 of file FixedListI.H.
Referenced by HashTable< Foam::phase * >::erase().
|
inline |
Return const_iterator to begin traversing the constant FixedList.
Definition at line 495 of file FixedListI.H.
|
inline |
Return const_iterator to end traversing the constant FixedList.
Definition at line 519 of file FixedListI.H.
|
inline |
Return reverse_iterator to begin reverse traversing the FixedList.
Definition at line 535 of file FixedListI.H.
|
inline |
Return reverse_iterator to end reverse traversing the FixedList.
Definition at line 559 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to begin reverse traversing FixedList.
Definition at line 551 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to end reverse traversing FixedList.
Definition at line 575 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to begin reverse traversing FixedList.
Definition at line 543 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to end reverse traversing FixedList.
Definition at line 567 of file FixedListI.H.
|
inlinestaticconstexprnoexcept |
Always false since zero-sized FixedList is compile-time disabled.
Definition at line 381 of file FixedList.H.
|
inlinestaticconstexprnoexcept |
Return the number of elements in the FixedList.
Definition at line 384 of file FixedList.H.
Referenced by DynamicList< Foam::FixedList< scalar, 3 > >::append(), isoSurface::generateFaceTriPoints(), indexedCell< Gt, Cb >::globallyOrderedCellVertices(), isoSurface::isoSurface(), isoSurfaceCell::isoSurfaceCell(), HashSet< Foam::string >::operator=(), pointConstraint::unconstrainedDirections(), and indexedCell< Gt, Cb >::vertexGlobalIndices().
|
inlinestaticconstexprnoexcept |
The dimensioned size (template parameter N) of the FixedList.
Definition at line 387 of file FixedList.H.
Swap lists by swapping the content of the individual list elements.
Definition at line 346 of file FixedListI.H.
Referenced by Foam::Swap().
Equality operation on FixedLists of the same type.
Returns true when the FixedLists are element-wise equal (using FixedList::value_type::operator==). Takes linear time
Definition at line 134 of file FixedList.C.
The opposite of the equality operation. Takes linear time.
Definition at line 178 of file FixedList.C.
Compare two FixedLists lexicographically. Takes linear time.
Definition at line 154 of file FixedList.C.
Compare two FixedLists lexicographically. Takes linear time.
Definition at line 185 of file FixedList.C.
Return true if !(a > b). Takes linear time.
Definition at line 192 of file FixedList.C.
Return true if !(a < b). Takes linear time.
Definition at line 199 of file FixedList.C.
Write the list as a dictionary entry with keyword.
Definition at line 52 of file FixedListIO.C.
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 68 of file FixedListIO.C.
const typedef T* const_pointer |
The pointer type for const access to value_type items.
Definition at line 110 of file FixedList.H.
const typedef T& const_reference |
The type used for reading from constant value_type objects.
Definition at line 116 of file FixedList.H.
const typedef T* const_iterator |
Random access iterator for traversing FixedList.
Definition at line 122 of file FixedList.H.