A 1D vector of objects of type <T> with a fixed length <N>. More...
Classes | |
struct | Hash |
Deprecated(2021-04) hashing functor. Use hasher() More... | |
struct | hasher |
Hashing functor 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 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 T * | iterator |
Random access iterator for traversing FixedList. More... | |
typedef const T * | const_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 Foam::zero) | |
Construct and initialize all entries to zero. More... | |
FixedList (const FixedList< T, N > &list) | |
Copy construct. More... | |
FixedList (FixedList< T, N > &&list) | |
Move construct by using move assignment for the individual list elements. More... | |
FixedList (std::initializer_list< T > list) | |
Construct from an initializer list. Runtime size check. More... | |
FixedList (const UList< T > &list) | |
Construct from UList. Runtime size check. More... | |
template<unsigned AnyNum> | |
FixedList (const FixedList< T, AnyNum > &list, const FixedList< label, N > &indices) | |
Copy construct from a subset of the input. No size check. More... | |
FixedList (const UList< T > &list, const FixedList< label, N > &indices) | |
Copy construct from a subset of the input. No size check. More... | |
FixedList (Istream &is) | |
Construct from Istream. More... | |
autoPtr< FixedList< T, N > > | clone () const |
Clone. More... | |
const T * | cdata () const noexcept |
Return pointer to the underlying array serving as data storage. More... | |
T * | data () noexcept |
Return pointer to the underlying array serving as data storage. More... | |
const char * | cdata_bytes () const noexcept |
Return pointer to the underlying array serving as data storage,. More... | |
char * | data_bytes () noexcept |
Return pointer to the underlying array serving as data storage,. More... | |
template<unsigned Index> | |
T & | get () noexcept |
Element access using compile-time indexing. More... | |
template<unsigned Index> | |
const T & | get () const noexcept |
Element access using compile-time indexing. More... | |
T & | front () noexcept |
Access first element of the list, position [0]. More... | |
const T & | front () const noexcept |
Access first element of the list, position [0]. More... | |
T & | back () noexcept |
Access last element of the list, position [N-1]. More... | |
const T & | back () const noexcept |
Access last element of the list, position [N-1]. More... | |
label | fcIndex (const label i) const noexcept |
Return the forward circular index, i.e. next index which returns to the first at the end 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... | |
label | rcIndex (const label i) const noexcept |
Return the reverse circular index, i.e. previous index which returns to the last at the beginning of 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 | 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... | |
bool | contains (const T &val) const |
True if the value is contained in the list. More... | |
bool | contains (const T &val, label pos, label len=-1) const |
Is the value contained in the list? More... | |
label | find (const T &val) const |
Find index of the first occurrence of the value. More... | |
label | find (const T &val, label pos, 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... | |
void | resize (const label n) |
Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing in full debug). More... | |
void | resize_fill (const label n, const T &val) |
Set val for all elements. Any resizing is ignored (Fatal with bad sizing in full debug). More... | |
void | resize_nocopy (const label n) |
Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing in full debug). More... | |
void | setSize (const label n) |
Dummy function, to make FixedList consistent with List. More... | |
void | fill (const T &val) |
Assign all entries to the given value. More... | |
void | fill (const Foam::zero) |
Assign all entries to zero. 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) |
Transfer by swapping using a move assignment for the content of the individual list elements. More... | |
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 UList< T > &list) |
Assignment to UList 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) |
Assign all entries to the given value. fill() More... | |
void | operator= (const Foam::zero) |
Assign all entries to zero. fill() More... | |
void | operator= (const FixedList< T, N > &list) |
Copy assignment. More... | |
void | operator= (FixedList< T, N > &&list) |
Move assignment. More... | |
iterator | begin () noexcept |
Return an iterator to begin traversing the FixedList. More... | |
iterator | end () noexcept |
Return an iterator to end traversing the FixedList. More... | |
const_iterator | cbegin () const noexcept |
Return const_iterator to begin traversing the constant FixedList. More... | |
const_iterator | cend () const noexcept |
Return const_iterator to end traversing the constant FixedList. More... | |
const_iterator | begin () const noexcept |
Return const_iterator to begin traversing the constant FixedList. More... | |
const_iterator | end () const noexcept |
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 > &other) |
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... | |
Istream & | readList (Istream &is) |
Read from Istream, discarding contents of existing List. 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... | |
T & | first () noexcept |
Access first element of the list, position [0] - front() More... | |
const T & | first () const noexcept |
Access first element of the list, position [0] - front() More... | |
T & | last () noexcept |
Access last element of the list, position [N-1] - back() More... | |
const T & | last () const noexcept |
Access last element of the list, position [N-1] - back() More... | |
bool | found (const T &val, label pos=0) const |
Same as contains() More... | |
FixedList (const T list[N]) | |
Deprecated: copy construct from C-array. More... | |
void | operator= (const T list[N]) |
Deprecated: assignment from C-array. More... | |
Static Public Member Functions | |
static const FixedList< T, N > & | null () |
Return a null FixedList. More... | |
static std::streamsize | size_bytes () noexcept |
Number of contiguous bytes for the list data,. More... | |
static std::streamsize | byteSize () |
Number of contiguous bytes for the list data, runtime FatalError if type is not contiguous. 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... | |
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) |
Use the readList() method to read contents from Istream. More... | |
A 1D vector of objects of type <T> with a fixed length <N>.
Definition at line 107 of file HashTable.H.
typedef T value_type |
The value type the FixedList contains.
Definition at line 108 of file FixedList.H.
The pointer type for non-const access to value_type items.
Definition at line 113 of file FixedList.H.
typedef const T* const_pointer |
The pointer type for const access to value_type items.
Definition at line 118 of file FixedList.H.
The type used for storing into value_type objects.
Definition at line 123 of file FixedList.H.
typedef const T& const_reference |
The type used for reading from constant value_type objects.
Definition at line 128 of file FixedList.H.
Random access iterator for traversing FixedList.
Definition at line 133 of file FixedList.H.
typedef const T* const_iterator |
Random access iterator for traversing FixedList.
Definition at line 138 of file FixedList.H.
typedef label size_type |
The type to represent the size of a FixedList.
Definition at line 143 of file FixedList.H.
typedef label difference_type |
The difference between iterator objects.
Definition at line 148 of file FixedList.H.
typedef std::reverse_iterator<iterator> reverse_iterator |
Reverse iterator (non-const access)
Definition at line 153 of file FixedList.H.
typedef std::reverse_iterator<const_iterator> const_reverse_iterator |
Reverse iterator (const access)
Definition at line 158 of file FixedList.H.
|
default |
Default construct.
Construct and initialize all entries to given value.
Definition at line 36 of file FixedListI.H.
|
inlineexplicit |
Construct and initialize all entries to zero.
Definition at line 43 of file FixedListI.H.
Copy construct.
Definition at line 50 of file FixedListI.H.
Move construct by using move assignment for the individual list elements.
Definition at line 58 of file FixedListI.H.
Construct from an initializer list. Runtime size check.
Definition at line 66 of file FixedListI.H.
Construct from UList. Runtime size check.
Definition at line 74 of file FixedListI.H.
Copy construct from a subset of the input. No size check.
Definition at line 84 of file FixedListI.H.
Copy construct from a subset of the input. No size check.
Definition at line 98 of file FixedListI.H.
Construct from Istream.
Definition at line 49 of file FixedListIO.C.
Deprecated: copy construct from C-array.
Definition at line 756 of file FixedList.H.
|
protected |
Write the FixedList with its compound type.
Definition at line 30 of file FixedListIO.C.
|
inlinestatic |
Return a null FixedList.
Definition at line 27 of file FixedListI.H.
|
inline |
Clone.
Definition at line 112 of file FixedListI.H.
|
inlinenoexcept |
Return pointer to the underlying array serving as data storage.
Definition at line 122 of file FixedListI.H.
|
inlinenoexcept |
Return pointer to the underlying array serving as data storage.
Definition at line 130 of file FixedListI.H.
|
inlinenoexcept |
Return pointer to the underlying array serving as data storage,.
reinterpreted as byte data
Definition at line 138 of file FixedListI.H.
Referenced by FixedList< point, 2 >::writeList().
|
inlinenoexcept |
Return pointer to the underlying array serving as data storage,.
reinterpreted as byte data
Definition at line 146 of file FixedListI.H.
Referenced by FixedList< point, 2 >::readList().
|
inlinestaticnoexcept |
Number of contiguous bytes for the list data,.
Definition at line 153 of file FixedListI.H.
Referenced by FixedList< point, 2 >::readList(), and FixedList< point, 2 >::writeList().
|
static |
Number of contiguous bytes for the list data, runtime FatalError if type is not contiguous.
Definition at line 27 of file FixedList.C.
|
inlinenoexcept |
Element access using compile-time indexing.
Definition at line 161 of file FixedListI.H.
|
inlinenoexcept |
Element access using compile-time indexing.
Definition at line 170 of file FixedListI.H.
|
inlinenoexcept |
Access first element of the list, position [0].
Definition at line 178 of file FixedListI.H.
Referenced by FixedList< point, 2 >::first().
|
inlinenoexcept |
Access first element of the list, position [0].
Definition at line 185 of file FixedListI.H.
|
inlinenoexcept |
Access last element of the list, position [N-1].
Definition at line 192 of file FixedListI.H.
Referenced by FixedList< point, 2 >::last().
|
inlinenoexcept |
Access last element of the list, position [N-1].
Definition at line 199 of file FixedListI.H.
|
inlinenoexcept |
Return the forward circular index, i.e. next index which returns to the first at the end of the list.
Definition at line 206 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 213 of file FixedListI.H.
|
inline |
Return forward circular value (ie, next value in the list)
Definition at line 220 of file FixedListI.H.
|
inlinenoexcept |
Return the reverse circular index, i.e. previous index which returns to the last at the beginning of the list.
Definition at line 227 of file FixedListI.H.
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 234 of file FixedListI.H.
|
inline |
Return reverse circular value (ie, previous value in the list)
Definition at line 241 of file FixedListI.H.
|
inline |
Check start is within valid range [0,size)
Definition at line 248 of file FixedListI.H.
|
inline |
Check size is identical to template parameter N.
Definition at line 261 of file FixedListI.H.
Referenced by FixedList< point, 2 >::readList().
|
inline |
Check index is within valid range [0,N)
Definition at line 273 of file FixedListI.H.
|
inline |
True if all entries have identical values, and list is non-empty.
Definition at line 285 of file FixedListI.H.
|
inline |
True if the value is contained in the list.
Definition at line 303 of file FixedListI.H.
Referenced by face::connected(), and FixedList< point, 2 >::found().
|
inline |
Is the value contained in the list?
val | The value to search for |
pos | The first position to examine (no-op if -ve) |
len | The length of the search region (-ve until the end) |
Definition at line 312 of file FixedListI.H.
Foam::label find | ( | const T & | val | ) | const |
Find index of the first occurrence of the value.
val | The value to search for |
Definition at line 42 of file FixedList.C.
Referenced by triFace::which().
Foam::label find | ( | const T & | val, |
label | pos, | ||
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 (no-op if -ve) |
len | The length of the search region (-ve until the end) |
Definition at line 51 of file FixedList.C.
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 86 of file FixedList.C.
|
inline |
Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing in full debug).
Definition at line 323 of file FixedListI.H.
Referenced by FixedList< point, 2 >::setSize().
|
inline |
Set val for all elements. Any resizing is ignored (Fatal with bad sizing in full debug).
Definition at line 332 of file FixedListI.H.
|
inline |
Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing in full debug).
Definition at line 342 of file FixedListI.H.
|
inline |
Dummy function, to make FixedList consistent with List.
Definition at line 436 of file FixedList.H.
Referenced by snappyLayerDriver::addLayers(), blockDescriptor::facePoints(), refinementHistory::refinementHistory(), and shellSurfaces::shellSurfaces().
|
inline |
Assign all entries to the given value.
Definition at line 351 of file FixedListI.H.
|
inline |
Assign all entries to zero.
Definition at line 359 of file FixedListI.H.
void moveFirst | ( | const label | i | ) |
Move element to the first position.
Definition at line 110 of file FixedList.C.
void moveLast | ( | const label | i | ) |
Move element to the last position.
Definition at line 122 of file FixedList.C.
void swapFirst | ( | const label | i | ) |
Swap element with the first element.
Definition at line 134 of file FixedList.C.
void swapLast | ( | const label | i | ) |
Swap element with the last element.
Definition at line 146 of file FixedList.C.
Transfer by swapping using a move assignment for the content of the individual list elements.
Definition at line 388 of file FixedListI.H.
|
inline |
Return element of FixedList.
Definition at line 403 of file FixedListI.H.
|
inline |
Return element of constant FixedList.
Definition at line 413 of file FixedListI.H.
Assignment to UList operator. Takes linear time.
Definition at line 423 of file FixedListI.H.
Referenced by boolVector::operator=().
|
inline |
Assignment to an initializer list. Takes linear time.
Definition at line 431 of file FixedListI.H.
|
inline |
Assign all entries to the given value. fill()
Definition at line 439 of file FixedListI.H.
|
inline |
Assign all entries to zero. fill()
Definition at line 446 of file FixedListI.H.
Copy assignment.
Definition at line 453 of file FixedListI.H.
Move assignment.
Definition at line 466 of file FixedListI.H.
|
inlinenoexcept |
Return an iterator to begin traversing the FixedList.
Definition at line 482 of file FixedListI.H.
Referenced by bitSet::bitSet(), edge::erase(), FixedList< point, 2 >::FixedList(), HashSet< word, Hash< word > >::HashSet(), HashSet< word, Hash< word > >::insert(), edge::insert(), Foam::operator*(), Foam::operator/(), List< Field< scalar > >::operator=(), HashSet< word, Hash< word > >::operator=(), FixedList< point, 2 >::operator=(), DynamicList< Foam::vector >::push_back(), bitSet::set(), FixedList< point, 2 >::transfer(), bitSet::unset(), and HashSet< word, Hash< word > >::unset().
|
inlinenoexcept |
Return an iterator to end traversing the FixedList.
Definition at line 506 of file FixedListI.H.
Referenced by bitSet::bitSet(), edge::erase(), FixedList< point, 2 >::FixedList(), HashSet< word, Hash< word > >::HashSet(), HashSet< word, Hash< word > >::insert(), edge::insert(), List< Field< scalar > >::operator=(), HashSet< word, Hash< word > >::operator=(), FixedList< point, 2 >::operator=(), DynamicList< Foam::vector >::push_back(), bitSet::set(), FixedList< point, 2 >::transfer(), bitSet::unset(), and HashSet< word, Hash< word > >::unset().
|
inlinenoexcept |
Return const_iterator to begin traversing the constant FixedList.
Definition at line 498 of file FixedListI.H.
Referenced by HashTable< const regIOobject * >::erase(), FixedList< point, 2 >::operator<(), and FixedList< point, 2 >::operator==().
|
inlinenoexcept |
Return const_iterator to end traversing the constant FixedList.
Definition at line 522 of file FixedListI.H.
Referenced by HashTable< const regIOobject * >::erase(), and FixedList< point, 2 >::operator<().
|
inlinenoexcept |
Return const_iterator to begin traversing the constant FixedList.
Definition at line 490 of file FixedListI.H.
|
inlinenoexcept |
Return const_iterator to end traversing the constant FixedList.
Definition at line 514 of file FixedListI.H.
|
inline |
Return reverse_iterator to begin reverse traversing the FixedList.
Definition at line 530 of file FixedListI.H.
|
inline |
Return reverse_iterator to end reverse traversing the FixedList.
Definition at line 554 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to begin reverse traversing FixedList.
Definition at line 546 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to end reverse traversing FixedList.
Definition at line 570 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to begin reverse traversing FixedList.
Definition at line 538 of file FixedListI.H.
|
inline |
Return const_reverse_iterator to end reverse traversing FixedList.
Definition at line 562 of file FixedListI.H.
|
inlinestaticnoexcept |
Always false since zero-sized FixedList is compile-time disabled.
Definition at line 595 of file FixedList.H.
Referenced by faMeshDistributor::distribute().
|
inlinestaticnoexcept |
Return the number of elements in the FixedList.
Definition at line 600 of file FixedList.H.
Referenced by isoSurfacePoint::generateFaceTriPoints(), indexedCell< Gt, Cb >::globallyOrderedCellVertices(), isoSurfaceCell::isoSurfaceCell(), isoSurfacePoint::isoSurfacePoint(), List< Field< scalar > >::operator=(), HashSet< word, Hash< word > >::operator=(), DynamicList< Foam::vector >::push_back(), pointConstraint::unconstrainedDirections(), patchEdgeFaceRegions::updateEdge(), indexedCell< Gt, Cb >::vertexGlobalIndices(), and lumpedPointState::writeVTP().
|
inlinestaticnoexcept |
The dimensioned size (template parameter N) of the FixedList.
Definition at line 605 of file FixedList.H.
Swap lists by swapping the content of the individual list elements.
Essentially std::swap_ranges
Definition at line 372 of file FixedListI.H.
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 162 of file FixedList.C.
The opposite of the equality operation. Takes linear time.
Definition at line 192 of file FixedList.C.
Compare two FixedLists lexicographically. Takes linear time.
Definition at line 176 of file FixedList.C.
Compare two FixedLists lexicographically. Takes linear time.
Definition at line 199 of file FixedList.C.
Return true if !(a > b). Takes linear time.
Definition at line 206 of file FixedList.C.
Return true if !(a < b). Takes linear time.
Definition at line 213 of file FixedList.C.
Foam::Istream & readList | ( | Istream & | is | ) |
Read from Istream, discarding contents of existing List.
Definition at line 146 of file FixedListIO.C.
Write the list as a dictionary entry with keyword.
Definition at line 59 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 75 of file FixedListIO.C.
|
inlinenoexcept |
Access first element of the list, position [0] - front()
Definition at line 727 of file FixedList.H.
Referenced by LangmuirHinshelwoodReactionRate::write().
|
inlinenoexcept |
Access first element of the list, position [0] - front()
Definition at line 732 of file FixedList.H.
|
inlinenoexcept |
Access last element of the list, position [N-1] - back()
Definition at line 737 of file FixedList.H.
Referenced by pimpleControl::criteriaSatisfied(), and solutionControl::maxTypeResidual().
|
inlinenoexcept |
Access last element of the list, position [N-1] - back()
Definition at line 742 of file FixedList.H.
|
inline |
Same as contains()
Definition at line 747 of file FixedList.H.
Referenced by wallBoundedParticle::isTriAlongTrack().
|
inline |
Deprecated: assignment from C-array.
Definition at line 763 of file FixedList.H.
Use the readList() method to read contents from Istream.
Definition at line 800 of file FixedList.H.