Loading...
Searching...
No Matches
FixedList< T, N > Class Template Reference

A 1D vector of objects of type <T> with a fixed length <N>. More...

#include <FixedList.H>

Inherited by Pair< labelPair >, Pair< label >, Pair< word >, Pair< wordPair >, Pair< point >, and hasher< word >.

Classes

struct  hasher
 Hashing functor for FixedList. More...
struct  Hash
 Deprecated(2021-04) hashing functor. Use hasher(). More...

Public Types

typedef T value_type
 The value type the FixedList contains.
typedef Tpointer
 The pointer type for non-const access to value_type items.
typedef const Tconst_pointer
 The pointer type for const access to value_type items.
typedef Treference
 The type used for storing into value_type objects.
typedef const Tconst_reference
 The type used for reading from constant value_type objects.
typedef Titerator
 Random access iterator for traversing FixedList.
typedef const Tconst_iterator
 Random access iterator for traversing FixedList.
typedef label size_type
 The type to represent the size of a FixedList.
typedef label difference_type
 The difference between iterator objects.
typedef std::reverse_iterator< iteratorreverse_iterator
 Reverse iterator (non-const access).
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Reverse iterator (const access).

Public Member Functions

 FixedList ()=default
 Default construct.
 FixedList (const T &val)
 Construct and initialize all entries to given value.
 FixedList (Foam::zero)
 Construct and initialize all entries to zero.
 FixedList (const FixedList< T, N > &list)
 Copy construct.
 FixedList (FixedList< T, N > &&list)
 Move construct by using move assignment for the individual list elements.
 FixedList (std::initializer_list< T > list)
 Construct from an initializer list. Runtime size check.
 FixedList (const UList< T > &list)
 Construct from UList. Runtime size check.
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.
 FixedList (const UList< T > &list, const FixedList< label, N > &indices)
 Copy construct from a subset of the input. No size check.
 FixedList (Istream &is)
 Construct from Istream.
autoPtr< FixedList< T, N > > clone () const
 Clone.
const Tcdata () const noexcept
 Return pointer to the underlying array serving as data storage.
Tdata () noexcept
 Return pointer to the underlying array serving as data storage.
const char * cdata_bytes () const noexcept
 Return pointer to the underlying array serving as data storage,.
char * data_bytes () noexcept
 Return pointer to the underlying array serving as data storage,.
template<unsigned Index>
Tget () noexcept
 Element access using compile-time indexing.
template<unsigned Index>
const Tget () const noexcept
 Element access using compile-time indexing.
Tfront () noexcept
 Access first element of the list, position [0].
const Tfront () const noexcept
 Access first element of the list, position [0].
Tback () noexcept
 Access last element of the list, position [N-1].
const Tback () const noexcept
 Access last element of the list, position [N-1].
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.
const TfcValue (const label i) const
 Return forward circular value (ie, next value in the list).
TfcValue (const label i)
 Return forward circular value (ie, next value in the list).
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.
const TrcValue (const label i) const
 Return reverse circular value (ie, previous value in the list).
TrcValue (const label i)
 Return reverse circular value (ie, previous value in the list).
void checkStart (const label start) const
 Check start is within valid range [0,size).
void checkSize (const label size) const
 Check size is identical to template parameter N.
void checkIndex (const label i) const
 Check index is within valid range [0,N).
bool uniform () const
 True if all entries have identical values, and list is non-empty.
bool contains (const T &val) const
 True if the value is contained in the list.
bool contains (const T &val, label pos, label len=-1) const
 Is the value contained in the list?
label find (const T &val) const
 Find index of the first occurrence of the value.
label find (const T &val, label pos, 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.
void resize (const label n)
 Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing in full debug).
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).
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).
void setSize (const label n)
 Dummy function, to make FixedList consistent with List.
void fill (const T &val)
 Assign all entries to the given value.
void fill (Foam::zero)
 Assign all entries to zero.
void moveFirst (const label i)
 Move element to the first position.
void moveLast (const label i)
 Move element to the last position.
void swapFirst (const label i)
 Swap element with the first element.
void swapLast (const label i)
 Swap element with the last element.
void transfer (FixedList< T, N > &list)
 Transfer by swapping using a move assignment for the content of the individual list elements.
Toperator[] (const label i)
 Return element of FixedList.
const Toperator[] (const label i) const
 Return element of constant FixedList.
void operator= (const UList< T > &list)
 Assignment to UList operator. Takes linear time.
void operator= (std::initializer_list< T > list)
 Assignment to an initializer list. Takes linear time.
void operator= (const T &val)
 Assign all entries to the given value. fill().
void operator= (Foam::zero)
 Assign all entries to zero. fill().
void operator= (const FixedList< T, N > &list)
 Copy assignment.
void operator= (FixedList< T, N > &&list)
 Move assignment.
iterator begin () noexcept
 Return an iterator to begin traversing the FixedList.
iterator end () noexcept
 Return an iterator to end traversing the FixedList.
iterator begin (const int i) noexcept
 Return iterator at offset i from begin, clamped to [0,N] range.
const_iterator cbegin () const noexcept
 Return const_iterator to begin traversing the constant FixedList.
const_iterator cend () const noexcept
 Return const_iterator to end traversing the constant FixedList.
const_iterator begin () const noexcept
 Return const_iterator to begin traversing the constant FixedList.
const_iterator end () const noexcept
 Return const_iterator to end traversing the constant FixedList.
const_iterator cbegin (const int i) const noexcept
 Return const_iterator at offset i from begin, clamped to [0,N] range.
const_iterator begin (const int i) const noexcept
 Return const_iterator at offset i from begin, clamped to [0,N] range.
reverse_iterator rbegin ()
 Return reverse_iterator to begin reverse traversing the FixedList.
reverse_iterator rend ()
 Return reverse_iterator to end reverse traversing the FixedList.
const_reverse_iterator crbegin () const
 Return const_reverse_iterator to begin reverse traversing FixedList.
const_reverse_iterator crend () const
 Return const_reverse_iterator to end reverse traversing FixedList.
const_reverse_iterator rbegin () const
 Return const_reverse_iterator to begin reverse traversing FixedList.
const_reverse_iterator rend () const
 Return const_reverse_iterator to end reverse traversing FixedList.
void swap (FixedList< T, N > &other)
 Swap lists by swapping the content of the individual list elements.
bool operator== (const FixedList< T, N > &list) const
 Equality operation on FixedLists of the same type.
bool operator!= (const FixedList< T, N > &list) const
 The opposite of the equality operation. Takes linear time.
bool operator< (const FixedList< T, N > &list) const
 Compare two FixedLists lexicographically. Takes linear time.
bool operator> (const FixedList< T, N > &list) const
 Compare two FixedLists lexicographically. Takes linear time.
bool operator<= (const FixedList< T, N > &list) const
 Return true if !(a > b). Takes linear time.
bool operator>= (const FixedList< T, N > &list) const
 Return true if !(a < b). Takes linear time.
IstreamreadList (Istream &is)
 Read from Istream, discarding contents of existing List.
void writeEntry (const word &keyword, Ostream &os) const
 Write the list as a dictionary entry with keyword.
OstreamwriteList (Ostream &os, const label shortLen=0) const
 Write List, with line-breaks in ASCII when length exceeds shortLen.
Tfirst () noexcept
 Access first element of the list, position [0] - front().
const Tfirst () const noexcept
 Access first element of the list, position [0] - front().
Tlast () noexcept
 Access last element of the list, position [N-1] - back().
const Tlast () const noexcept
 Access last element of the list, position [N-1] - back().
bool found (const T &val, label pos=0) const
 Same as contains().
 FixedList (const T list[N])
 Deprecated: copy construct from C-array.
void operator= (const T list[N])
 Deprecated: assignment from C-array.

Static Public Member Functions

static const FixedList< T, N > & null () noexcept
 Return a null FixedList (reference to a nullObject). Read/write access is questionable.
static std::streamsize size_bytes () noexcept
 Number of contiguous bytes for the list data,.
static std::streamsize byteSize ()
 Number of contiguous bytes for the list data, runtime FatalError if type is not contiguous.
static constexpr bool empty () noexcept
 Always false since zero-sized FixedList is compile-time disabled.
static constexpr label size () noexcept
 Return the number of elements in the FixedList.
static constexpr unsigned max_size () noexcept
 The dimensioned size (template parameter N) of the FixedList.

Protected Member Functions

void writeEntry (Ostream &os) const
 Write the FixedList with its compound type.

Friends

Istreamoperator>> (Istream &is, FixedList< T, N > &list)
 Use the readList() method to read contents from Istream.

Detailed Description

template<class T, unsigned N>
class Foam::FixedList< T, N >

A 1D vector of objects of type <T> with a fixed length <N>.

Source files

Definition at line 72 of file FixedList.H.

Member Typedef Documentation

◆ value_type

template<class T, unsigned N>
typedef T value_type

The value type the FixedList contains.

Definition at line 105 of file FixedList.H.

◆ pointer

template<class T, unsigned N>
typedef T* pointer

The pointer type for non-const access to value_type items.

Definition at line 110 of file FixedList.H.

◆ const_pointer

template<class T, unsigned N>
typedef const T* const_pointer

The pointer type for const access to value_type items.

Definition at line 115 of file FixedList.H.

◆ reference

template<class T, unsigned N>
typedef T& reference

The type used for storing into value_type objects.

Definition at line 120 of file FixedList.H.

◆ const_reference

template<class T, unsigned N>
typedef const T& const_reference

The type used for reading from constant value_type objects.

Definition at line 125 of file FixedList.H.

◆ iterator

template<class T, unsigned N>
typedef T* iterator

Random access iterator for traversing FixedList.

Definition at line 130 of file FixedList.H.

◆ const_iterator

template<class T, unsigned N>
typedef const T* const_iterator

Random access iterator for traversing FixedList.

Definition at line 135 of file FixedList.H.

◆ size_type

template<class T, unsigned N>
typedef label size_type

The type to represent the size of a FixedList.

Definition at line 140 of file FixedList.H.

◆ difference_type

template<class T, unsigned N>
typedef label difference_type

The difference between iterator objects.

Definition at line 145 of file FixedList.H.

◆ reverse_iterator

template<class T, unsigned N>
typedef std::reverse_iterator<iterator> reverse_iterator

Reverse iterator (non-const access).

Definition at line 150 of file FixedList.H.

◆ const_reverse_iterator

template<class T, unsigned N>
typedef std::reverse_iterator<const_iterator> const_reverse_iterator

Reverse iterator (const access).

Definition at line 155 of file FixedList.H.

Constructor & Destructor Documentation

◆ FixedList() [1/11]

◆ FixedList() [2/11]

template<class T, unsigned N>
FixedList ( const T & val)
inlineexplicit

Construct and initialize all entries to given value.

Definition at line 27 of file FixedListI.H.

References fill(), and Foam::T().

Here is the call graph for this function:

◆ FixedList() [3/11]

template<class T, unsigned N>
FixedList ( Foam::zero )
inlineexplicit

Construct and initialize all entries to zero.

Definition at line 34 of file FixedListI.H.

References fill().

Here is the call graph for this function:

◆ FixedList() [4/11]

template<class T, unsigned N>
FixedList ( const FixedList< T, N > & list)
inline

Copy construct.

Definition at line 41 of file FixedListI.H.

References begin(), end(), and FixedList().

Here is the call graph for this function:

◆ FixedList() [5/11]

template<class T, unsigned N>
FixedList ( FixedList< T, N > && list)
inline

Move construct by using move assignment for the individual list elements.

Definition at line 49 of file FixedListI.H.

References FixedList().

Here is the call graph for this function:

◆ FixedList() [6/11]

template<class T, unsigned N>
FixedList ( std::initializer_list< T > list)
inline

Construct from an initializer list. Runtime size check.

Definition at line 57 of file FixedListI.H.

References checkSize(), and N().

Here is the call graph for this function:

◆ FixedList() [7/11]

template<class T, unsigned N>
FixedList ( const UList< T > & list)
inlineexplicit

Construct from UList. Runtime size check.

Definition at line 65 of file FixedListI.H.

References UList< T >::begin(), checkSize(), N(), and UList< T >::size().

Here is the call graph for this function:

◆ FixedList() [8/11]

template<class T, unsigned N>
template<unsigned AnyNum>
FixedList ( const FixedList< T, AnyNum > & list,
const FixedList< label, N > & indices )
inline

Copy construct from a subset of the input. No size check.

Definition at line 74 of file FixedListI.H.

References FixedList(), and N().

Here is the call graph for this function:

◆ FixedList() [9/11]

template<class T, unsigned N>
FixedList ( const UList< T > & list,
const FixedList< label, N > & indices )
inline

Copy construct from a subset of the input. No size check.

Definition at line 88 of file FixedListI.H.

References FixedList(), and N().

Here is the call graph for this function:

◆ FixedList() [10/11]

template<class T, unsigned N>
FixedList ( Istream & is)
explicit

Construct from Istream.

Definition at line 52 of file FixedListIO.C.

References readList().

Here is the call graph for this function:

◆ FixedList() [11/11]

template<class T, unsigned N>
FixedList ( const T list[N])
inlineexplicit

Deprecated: copy construct from C-array.

Definition at line 777 of file FixedList.H.

Member Function Documentation

◆ writeEntry() [1/2]

template<class T, unsigned N>
void writeEntry ( Ostream & os) const
protected

Write the FixedList with its compound type.

Definition at line 30 of file FixedListIO.C.

References IOstreamOption::BINARY, Foam::is_contiguous_v, token::compound::isCompound(), N(), os(), and token::SPACE.

Referenced by writeEntry().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ null()

template<class T, unsigned N>
const FixedList< T, N > & null ( )
inlinestaticnoexcept

Return a null FixedList (reference to a nullObject). Read/write access is questionable.

Definition at line 164 of file FixedList.H.

◆ clone()

template<class T, unsigned N>
Foam::autoPtr< Foam::FixedList< T, N > > clone ( ) const
inline

Clone.

Definition at line 103 of file FixedListI.H.

References Foam::New().

Here is the call graph for this function:

◆ cdata()

template<class T, unsigned N>
const T * cdata ( ) const
inlinenoexcept

Return pointer to the underlying array serving as data storage.

Definition at line 113 of file FixedListI.H.

References Foam::noexcept.

◆ data()

template<class T, unsigned N>
T * data ( )
inlinenoexcept

Return pointer to the underlying array serving as data storage.

Definition at line 121 of file FixedListI.H.

References Foam::noexcept.

◆ cdata_bytes()

template<class T, unsigned N>
const char * cdata_bytes ( ) const
inlinenoexcept

Return pointer to the underlying array serving as data storage,.

reinterpreted as byte data

Note
Only meaningful for contiguous data

Definition at line 129 of file FixedListI.H.

References Foam::noexcept.

Referenced by writeList().

Here is the caller graph for this function:

◆ data_bytes()

template<class T, unsigned N>
char * data_bytes ( )
inlinenoexcept

Return pointer to the underlying array serving as data storage,.

reinterpreted as byte data

Note
Only meaningful for contiguous data

Definition at line 137 of file FixedListI.H.

References Foam::noexcept.

Referenced by readList().

Here is the caller graph for this function:

◆ size_bytes()

template<class T, unsigned N>
std::streamsize size_bytes ( )
inlinestaticnoexcept

Number of contiguous bytes for the list data,.

Note
Only meaningful for contiguous data

Definition at line 144 of file FixedListI.H.

References N(), Foam::noexcept, and Foam::T().

Referenced by byteSize(), readList(), and writeList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ byteSize()

template<class T, unsigned N>
std::streamsize byteSize ( )
static

Number of contiguous bytes for the list data, runtime FatalError if type is not contiguous.

Definition at line 27 of file FixedList.C.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::is_contiguous_v, and size_bytes().

Here is the call graph for this function:

◆ get() [1/2]

template<class T, unsigned N>
template<unsigned Index>
T & get ( )
inlinenoexcept

Element access using compile-time indexing.

Definition at line 152 of file FixedListI.H.

References N(), Foam::noexcept, and Foam::T().

Referenced by edge::edge(), linePoints::linePoints(), and edge::sorted().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get() [2/2]

template<class T, unsigned N>
template<unsigned Index>
const T & get ( ) const
inlinenoexcept

Element access using compile-time indexing.

Definition at line 161 of file FixedListI.H.

References N(), Foam::noexcept, and Foam::T().

Here is the call graph for this function:

◆ front() [1/2]

template<class T, unsigned N>
T & front ( )
inlinenoexcept

Access first element of the list, position [0].

Definition at line 169 of file FixedListI.H.

References Foam::noexcept, and Foam::T().

Referenced by FixedList< scalar, 7 >::first(), and FixedList< scalar, 7 >::first().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ front() [2/2]

template<class T, unsigned N>
const T & front ( ) const
inlinenoexcept

Access first element of the list, position [0].

Definition at line 176 of file FixedListI.H.

References Foam::noexcept, and Foam::T().

Here is the call graph for this function:

◆ back() [1/2]

template<class T, unsigned N>
T & back ( )
inlinenoexcept

Access last element of the list, position [N-1].

Definition at line 183 of file FixedListI.H.

References N(), Foam::noexcept, and Foam::T().

Referenced by FixedList< scalar, 7 >::last(), and FixedList< scalar, 7 >::last().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ back() [2/2]

template<class T, unsigned N>
const T & back ( ) const
inlinenoexcept

Access last element of the list, position [N-1].

Definition at line 190 of file FixedListI.H.

References N(), Foam::noexcept, and Foam::T().

Here is the call graph for this function:

◆ fcIndex()

template<class T, unsigned N>
Foam::label fcIndex ( const label i) const
inlinenoexcept

Return the forward circular index, i.e. next index which returns to the first at the end of the list.

Definition at line 197 of file FixedListI.H.

References N().

Referenced by fcValue(), fcValue(), wallBoundedParticle::isTriAlongTrack(), and wallBoundedParticle::trackFaceTri().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fcValue() [1/2]

template<class T, unsigned N>
const T & fcValue ( const label i) const
inline

Return forward circular value (ie, next value in the list).

Definition at line 204 of file FixedListI.H.

References fcIndex(), operator[](), and Foam::T().

Here is the call graph for this function:

◆ fcValue() [2/2]

template<class T, unsigned N>
T & fcValue ( const label i)
inline

Return forward circular value (ie, next value in the list).

Definition at line 211 of file FixedListI.H.

References fcIndex(), operator[](), and Foam::T().

Here is the call graph for this function:

◆ rcIndex()

template<class T, unsigned N>
Foam::label rcIndex ( const label i) const
inlinenoexcept

Return the reverse circular index, i.e. previous index which returns to the last at the beginning of the list.

Definition at line 218 of file FixedListI.H.

References N().

Referenced by rcValue(), and rcValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rcValue() [1/2]

template<class T, unsigned N>
const T & rcValue ( const label i) const
inline

Return reverse circular value (ie, previous value in the list).

Definition at line 225 of file FixedListI.H.

References operator[](), rcIndex(), and Foam::T().

Here is the call graph for this function:

◆ rcValue() [2/2]

template<class T, unsigned N>
T & rcValue ( const label i)
inline

Return reverse circular value (ie, previous value in the list).

Definition at line 232 of file FixedListI.H.

References operator[](), rcIndex(), and Foam::T().

Here is the call graph for this function:

◆ checkStart()

template<class T, unsigned N>
void checkStart ( const label start) const
inline

Check start is within valid range [0,size).

Definition at line 239 of file FixedListI.H.

References FatalErrorInFunction, and N().

Here is the call graph for this function:

◆ checkSize()

template<class T, unsigned N>
void checkSize ( const label size) const
inline

Check size is identical to template parameter N.

Definition at line 252 of file FixedListI.H.

References FatalErrorInFunction, N(), and size().

Referenced by FixedList(), FixedList(), operator=(), readList(), and resize_fill().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ checkIndex()

template<class T, unsigned N>
void checkIndex ( const label i) const
inline

Check index is within valid range [0,N).

Definition at line 264 of file FixedListI.H.

Referenced by moveFirst(), moveLast(), operator[](), operator[](), swapFirst(), and swapLast().

Here is the caller graph for this function:

◆ uniform()

template<class T, unsigned N>
bool uniform ( ) const
inline

True if all entries have identical values, and list is non-empty.

Definition at line 276 of file FixedListI.H.

References empty(), and N().

Here is the call graph for this function:

◆ contains() [1/2]

template<class T, unsigned N>
bool contains ( const T & val) const
inline

True if the value is contained in the list.

Definition at line 294 of file FixedListI.H.

References Foam::T().

Referenced by face::connected(), and FixedList< scalar, 7 >::found().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ contains() [2/2]

template<class T, unsigned N>
bool contains ( const T & val,
label pos,
label len = -1 ) const
inline

Is the value contained in the list?

Parameters
valThe value to search for
posThe first position to examine (no-op if -ve)
lenThe length of the search region (-ve until the end)
Returns
true if found.

Definition at line 302 of file FixedListI.H.

References Foam::pos(), and Foam::T().

Here is the call graph for this function:

◆ find() [1/2]

template<class T, unsigned N>
Foam::label find ( const T & val) const

Find index of the first occurrence of the value.

Parameters
valThe value to search for
Returns
position in list or -1 if not found.

Definition at line 42 of file FixedList.C.

References cbegin(), cend(), and Foam::T().

Referenced by triFace::which().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find() [2/2]

template<class T, unsigned N>
Foam::label find ( const T & val,
label pos,
label len = -1 ) const

Find index of the first occurrence of the value.

Parameters
valThe value to search for
posThe first position to examine (no-op if -ve)
lenThe length of the search region (-ve until the end)
Returns
position in list or -1 if not found.

Definition at line 50 of file FixedList.C.

References cbegin(), N(), Foam::pos(), and Foam::T().

Here is the call graph for this function:

◆ rfind()

template<class T, unsigned N>
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.

Returns
position in list or -1 if not found.

Definition at line 86 of file FixedList.C.

References N(), Foam::pos(), and Foam::T().

Here is the call graph for this function:

◆ resize()

template<class T, unsigned N>
void resize ( const label n)
inline

Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing in full debug).

Definition at line 314 of file FixedListI.H.

References n.

Referenced by FixedList< scalar, 7 >::setSize().

Here is the caller graph for this function:

◆ resize_fill()

template<class T, unsigned N>
void resize_fill ( const label n,
const T & val )
inline

Set val for all elements. Any resizing is ignored (Fatal with bad sizing in full debug).

Definition at line 323 of file FixedListI.H.

References checkSize(), fill(), n, and Foam::T().

Here is the call graph for this function:

◆ resize_nocopy()

template<class T, unsigned N>
void resize_nocopy ( const label n)
inline

Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing in full debug).

Definition at line 333 of file FixedListI.H.

◆ setSize()

template<class T, unsigned N>
void setSize ( const label n)
inline

Dummy function, to make FixedList consistent with List.

Definition at line 437 of file FixedList.H.

◆ fill() [1/2]

template<class T, unsigned N>
void fill ( const T & val)
inline

Assign all entries to the given value.

Definition at line 342 of file FixedListI.H.

References N(), and Foam::T().

Referenced by FixedList(), FixedList(), operator=(), readList(), and resize_fill().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fill() [2/2]

template<class T, unsigned N>
void fill ( Foam::zero )
inline

Assign all entries to zero.

Definition at line 350 of file FixedListI.H.

◆ moveFirst()

template<class T, unsigned N>
void moveFirst ( const label i)

Move element to the first position.

Definition at line 110 of file FixedList.C.

References checkIndex(), and Foam::Swap().

Here is the call graph for this function:

◆ moveLast()

template<class T, unsigned N>
void moveLast ( const label i)

Move element to the last position.

Definition at line 122 of file FixedList.C.

References checkIndex(), N(), and Foam::Swap().

Here is the call graph for this function:

◆ swapFirst()

template<class T, unsigned N>
void swapFirst ( const label i)

Swap element with the first element.

Definition at line 134 of file FixedList.C.

References checkIndex(), and Foam::Swap().

Here is the call graph for this function:

◆ swapLast()

template<class T, unsigned N>
void swapLast ( const label i)

Swap element with the last element.

Definition at line 146 of file FixedList.C.

References checkIndex(), N(), and Foam::Swap().

Here is the call graph for this function:

◆ transfer()

template<class T, unsigned N>
void transfer ( FixedList< T, N > & list)
inline

Transfer by swapping using a move assignment for the content of the individual list elements.

Definition at line 384 of file FixedListI.H.

References begin(), end(), and FixedList().

Here is the call graph for this function:

◆ operator[]() [1/2]

template<class T, unsigned N>
T & operator[] ( const label i)
inline

Return element of FixedList.

Definition at line 399 of file FixedListI.H.

References checkIndex(), and Foam::T().

Referenced by fcValue(), fcValue(), rcValue(), and rcValue().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator[]() [2/2]

template<class T, unsigned N>
const T & operator[] ( const label i) const
inline

Return element of constant FixedList.

Definition at line 409 of file FixedListI.H.

References checkIndex(), and Foam::T().

Here is the call graph for this function:

◆ operator=() [1/7]

template<class T, unsigned N>
void operator= ( const UList< T > & list)
inline

Assignment to UList operator. Takes linear time.

Definition at line 419 of file FixedListI.H.

Referenced by boolVector::operator=().

Here is the caller graph for this function:

◆ operator=() [2/7]

template<class T, unsigned N>
void operator= ( std::initializer_list< T > list)
inline

Assignment to an initializer list. Takes linear time.

Definition at line 427 of file FixedListI.H.

References checkSize(), and N().

Here is the call graph for this function:

◆ operator=() [3/7]

template<class T, unsigned N>
void operator= ( const T & val)
inline

Assign all entries to the given value. fill().

Definition at line 435 of file FixedListI.H.

References fill(), and Foam::T().

Here is the call graph for this function:

◆ operator=() [4/7]

template<class T, unsigned N>
void operator= ( Foam::zero )
inline

Assign all entries to zero. fill().

Definition at line 442 of file FixedListI.H.

◆ operator=() [5/7]

template<class T, unsigned N>
void operator= ( const FixedList< T, N > & list)
inline

Copy assignment.

Definition at line 449 of file FixedListI.H.

References begin(), end(), and FixedList().

Here is the call graph for this function:

◆ operator=() [6/7]

template<class T, unsigned N>
void operator= ( FixedList< T, N > && list)
inline

Move assignment.

Definition at line 462 of file FixedListI.H.

References FixedList().

Here is the call graph for this function:

◆ begin() [1/4]

template<class T, unsigned N>
Foam::FixedList< T, N >::iterator begin ( )
inlinenoexcept

◆ end() [1/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::iterator end ( )
inlinenoexcept

Return an iterator to end traversing the FixedList.

Definition at line 526 of file FixedListI.H.

References N(), and Foam::noexcept.

Referenced by crbegin(), edge::erase(), FixedList(), HashSet< Key, Hash >::HashSet(), edge::insert(), HashSet< Key, HashType >::insert(), operator=(), List< T >::operator=(), DynamicList< T, SizeMin >::push_back(), rbegin(), rbegin(), transfer(), and HashSet< Key, HashType >::unset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ begin() [2/4]

template<class T, unsigned N>
Foam::FixedList< T, N >::iterator begin ( const int i)
inlinenoexcept

Return iterator at offset i from begin, clamped to [0,N] range.

Definition at line 502 of file FixedListI.H.

References N().

Here is the call graph for this function:

◆ cbegin() [1/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::const_iterator cbegin ( ) const
inlinenoexcept

Return const_iterator to begin traversing the constant FixedList.

Definition at line 494 of file FixedListI.H.

References Foam::noexcept.

Referenced by find(), find(), operator<(), and operator==().

Here is the caller graph for this function:

◆ cend()

template<class T, unsigned N>
Foam::FixedList< T, N >::const_iterator cend ( ) const
inlinenoexcept

Return const_iterator to end traversing the constant FixedList.

Definition at line 542 of file FixedListI.H.

References Foam::noexcept.

Referenced by find(), operator<(), and operator==().

Here is the caller graph for this function:

◆ begin() [3/4]

template<class T, unsigned N>
Foam::FixedList< T, N >::const_iterator begin ( ) const
inlinenoexcept

Return const_iterator to begin traversing the constant FixedList.

Definition at line 486 of file FixedListI.H.

References Foam::noexcept.

◆ end() [2/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::const_iterator end ( ) const
inlinenoexcept

Return const_iterator to end traversing the constant FixedList.

Definition at line 534 of file FixedListI.H.

References N(), and Foam::noexcept.

Here is the call graph for this function:

◆ cbegin() [2/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::const_iterator cbegin ( const int i) const
inlinenoexcept

Return const_iterator at offset i from begin, clamped to [0,N] range.

Definition at line 518 of file FixedListI.H.

References N().

Here is the call graph for this function:

◆ begin() [4/4]

template<class T, unsigned N>
Foam::FixedList< T, N >::const_iterator begin ( const int i) const
inlinenoexcept

Return const_iterator at offset i from begin, clamped to [0,N] range.

Definition at line 510 of file FixedListI.H.

References N().

Here is the call graph for this function:

◆ rbegin() [1/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::reverse_iterator rbegin ( )
inline

Return reverse_iterator to begin reverse traversing the FixedList.

Definition at line 550 of file FixedListI.H.

References end().

Here is the call graph for this function:

◆ rend() [1/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::reverse_iterator rend ( )
inline

Return reverse_iterator to end reverse traversing the FixedList.

Definition at line 574 of file FixedListI.H.

References begin().

Here is the call graph for this function:

◆ crbegin()

template<class T, unsigned N>
Foam::FixedList< T, N >::const_reverse_iterator crbegin ( ) const
inline

Return const_reverse_iterator to begin reverse traversing FixedList.

Definition at line 566 of file FixedListI.H.

References end().

Here is the call graph for this function:

◆ crend()

template<class T, unsigned N>
Foam::FixedList< T, N >::const_reverse_iterator crend ( ) const
inline

Return const_reverse_iterator to end reverse traversing FixedList.

Definition at line 590 of file FixedListI.H.

◆ rbegin() [2/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::const_reverse_iterator rbegin ( ) const
inline

Return const_reverse_iterator to begin reverse traversing FixedList.

Definition at line 558 of file FixedListI.H.

References end().

Here is the call graph for this function:

◆ rend() [2/2]

template<class T, unsigned N>
Foam::FixedList< T, N >::const_reverse_iterator rend ( ) const
inline

Return const_reverse_iterator to end reverse traversing FixedList.

Definition at line 582 of file FixedListI.H.

◆ empty()

template<class T, unsigned N>
constexpr bool empty ( )
inlinestaticconstexprnoexcept

Always false since zero-sized FixedList is compile-time disabled.

Definition at line 614 of file FixedList.H.

Referenced by uniform().

Here is the caller graph for this function:

◆ size()

◆ max_size()

template<class T, unsigned N>
constexpr unsigned max_size ( )
inlinestaticconstexprnoexcept

The dimensioned size (template parameter N) of the FixedList.

Definition at line 624 of file FixedList.H.

◆ swap()

template<class T, unsigned N>
void swap ( FixedList< T, N > & other)
inline

Swap lists by swapping the content of the individual list elements.

Essentially std::swap_ranges

Definition at line 368 of file FixedListI.H.

References FixedList().

Referenced by Foam::Swap().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==()

template<class T, unsigned N>
bool operator== ( const FixedList< T, N > & list) const

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.

References cbegin(), cend(), and FixedList().

Referenced by operator!=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

template<class T, unsigned N>
bool operator!= ( const FixedList< T, N > & list) const

The opposite of the equality operation. Takes linear time.

Definition at line 192 of file FixedList.C.

References FixedList(), and operator==().

Here is the call graph for this function:

◆ operator<()

template<class T, unsigned N>
bool operator< ( const FixedList< T, N > & list) const

Compare two FixedLists lexicographically. Takes linear time.

Definition at line 176 of file FixedList.C.

References cbegin(), cend(), and FixedList().

Referenced by operator>=().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator>()

template<class T, unsigned N>
bool operator> ( const FixedList< T, N > & list) const

Compare two FixedLists lexicographically. Takes linear time.

Definition at line 199 of file FixedList.C.

References FixedList().

Here is the call graph for this function:

◆ operator<=()

template<class T, unsigned N>
bool operator<= ( const FixedList< T, N > & list) const

Return true if !(a > b). Takes linear time.

Definition at line 206 of file FixedList.C.

References FixedList().

Here is the call graph for this function:

◆ operator>=()

template<class T, unsigned N>
bool operator>= ( const FixedList< T, N > & list) const

Return true if !(a < b). Takes linear time.

Definition at line 213 of file FixedList.C.

References FixedList(), and operator<().

Here is the call graph for this function:

◆ readList()

◆ writeEntry() [2/2]

template<class T, unsigned N>
void writeEntry ( const word & keyword,
Ostream & os ) const

Write the list as a dictionary entry with keyword.

Definition at line 61 of file FixedListIO.C.

References os(), and writeEntry().

Here is the call graph for this function:

◆ writeList()

template<class T, unsigned N>
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 77 of file FixedListIO.C.

References IOstreamOption::BINARY, cdata_bytes(), FixedList(), Foam::is_contiguous_v, os(), and size_bytes().

Referenced by Foam::operator<<().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ first() [1/2]

template<class T, unsigned N>
T & first ( )
inlinenoexcept

Access first element of the list, position [0] - front().

Definition at line 748 of file FixedList.H.

Referenced by LangmuirHinshelwoodReactionRate::LangmuirHinshelwoodReactionRate(), and LangmuirHinshelwoodReactionRate::write().

Here is the caller graph for this function:

◆ first() [2/2]

template<class T, unsigned N>
const T & first ( ) const
inlinenoexcept

Access first element of the list, position [0] - front().

Definition at line 753 of file FixedList.H.

◆ last() [1/2]

template<class T, unsigned N>
T & last ( )
inlinenoexcept

Access last element of the list, position [N-1] - back().

Definition at line 758 of file FixedList.H.

Referenced by pimpleControl::criteriaSatisfied(), and solutionControl::maxTypeResidual().

Here is the caller graph for this function:

◆ last() [2/2]

template<class T, unsigned N>
const T & last ( ) const
inlinenoexcept

Access last element of the list, position [N-1] - back().

Definition at line 763 of file FixedList.H.

◆ found()

template<class T, unsigned N>
bool found ( const T & val,
label pos = 0 ) const
inline

Same as contains().

Definition at line 768 of file FixedList.H.

Referenced by wallBoundedParticle::isTriAlongTrack().

Here is the caller graph for this function:

◆ operator=() [7/7]

template<class T, unsigned N>
void operator= ( const T list[N])
inline

Deprecated: assignment from C-array.

Deprecated
(2023-08) - use other assignment operators

Definition at line 784 of file FixedList.H.

◆ operator>>

template<class T, unsigned N>
Istream & operator>> ( Istream & is,
FixedList< T, N > & list )
friend

Use the readList() method to read contents from Istream.

Definition at line 821 of file FixedList.H.

References FixedList(), and readList().


The documentation for this class was generated from the following files: