33template<
class T,
unsigned N>
40template<
class T,
unsigned N>
47template<
class T,
unsigned N>
51 std::copy(list.
begin(), list.
end(), v_);
55template<
class T,
unsigned N>
59 std::move(list.begin(), list.end(), v_);
63template<
class T,
unsigned N>
67 std::copy_n(list.begin(),
N, v_);
71template<
class T,
unsigned N>
75 std::copy_n(list.
begin(),
N, v_);
79template<
class T,
unsigned N>
80template<
unsigned AnyNum>
87 for (
unsigned i = 0; i <
N; ++i)
89 v_[i] = list[indices[i]];
94template<
class T,
unsigned N>
98 const FixedList<label, N>& indices
101 for (
unsigned i = 0; i <
N; ++i)
103 v_[i] = list[indices[i]];
108template<
class T,
unsigned N>
112 return autoPtr<FixedList<T, N>>::New(*
this);
118template<
class T,
unsigned N>
126template<
class T,
unsigned N>
134template<
class T,
unsigned N>
138 return reinterpret_cast<const char*
>(v_);
142template<
class T,
unsigned N>
146 return reinterpret_cast<char*
>(v_);
150template<
class T,
unsigned N>
157template<
class T,
unsigned N>
158template<
unsigned Index>
161 static_assert(Index <
N,
"Address outside FixedList range");
166template<
class T,
unsigned N>
167template<
unsigned Index>
170 static_assert(Index <
N,
"Address outside FixedList range");
175template<
class T,
unsigned N>
182template<
class T,
unsigned N>
189template<
class T,
unsigned N>
196template<
class T,
unsigned N>
203template<
class T,
unsigned N>
206 return (i ==
N-1 ? 0 : i+1);
210template<
class T,
unsigned N>
217template<
class T,
unsigned N>
224template<
class T,
unsigned N>
227 return (i ? i-1 :
N-1);
231template<
class T,
unsigned N>
238template<
class T,
unsigned N>
245template<
class T,
unsigned N>
248 if (start < 0 || (start &&
unsigned(start) >=
N))
252 <<
"start " << start <<
" out of range [0," <<
N <<
")"
258template<
class T,
unsigned N>
261 if (
unsigned(
size) !=
N)
270template<
class T,
unsigned N>
273 if (i < 0 ||
unsigned(i) >=
N)
276 <<
"index " << i <<
" out of range [0," <<
N <<
")"
282template<
class T,
unsigned N>
288 for (
unsigned i=1; i<
N; ++i)
300template<
class T,
unsigned N>
303 const auto iter = std::find(this->
cbegin(), this->
cend(), val);
304 return (iter != this->
cend());
308template<
class T,
unsigned N>
316 return (this->
find(val,
pos, len) >= 0);
320template<
class T,
unsigned N>
329template<
class T,
unsigned N>
339template<
class T,
unsigned N>
348template<
class T,
unsigned N>
352 std::fill_n(v_,
N, val);
356template<
class T,
unsigned N>
359 if constexpr (std::is_arithmetic_v<T>)
362 std::fill_n(v_,
N,
T(0));
366 for (
unsigned i = 0; i <
N; ++i)
374template<
class T,
unsigned N>
383 for (
unsigned i=0; i<
N; ++i)
390template<
class T,
unsigned N>
399 std::move(list.begin(), list.end(), v_);
405template<
class T,
unsigned N>
415template<
class T,
unsigned N>
425template<
class T,
unsigned N>
429 std::copy_n(list.
begin(),
N, v_);
433template<
class T,
unsigned N>
437 std::copy_n(list.begin(),
N, v_);
441template<
class T,
unsigned N>
448template<
class T,
unsigned N>
455template<
class T,
unsigned N>
464 std::copy(list.
begin(), list.
end(), v_);
468template<
class T,
unsigned N>
477 std::move(list.
begin(), list.
end(), v_);
483template<
class T,
unsigned N>
491template<
class T,
unsigned N>
499template<
class T,
unsigned N>
507template<
class T,
unsigned N>
511 return (v_ + (i < 0 ? 0 :
int(
N) < i ?
int(
N) : i));
515template<
class T,
unsigned N>
519 return (v_ + (i < 0 ? 0 :
int(
N) < i ?
int(
N) : i));
523template<
class T,
unsigned N>
527 return (v_ + (i < 0 ? 0 :
int(
N) < i ?
int(
N) : i));
531template<
class T,
unsigned N>
539template<
class T,
unsigned N>
547template<
class T,
unsigned N>
555template<
class T,
unsigned N>
563template<
class T,
unsigned N>
571template<
class T,
unsigned N>
579template<
class T,
unsigned N>
587template<
class T,
unsigned N>
595template<
class T,
unsigned N>
A 1D vector of objects of type <T> with a fixed length <N>.
const_iterator cend() const noexcept
void swap(FixedList< T, N > &other)
Swap lists by swapping the content of the individual list elements.
void resize_nocopy(const label n)
Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing...
const_reverse_iterator crbegin() const
Return const_reverse_iterator to begin reverse traversing FixedList.
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).
static std::streamsize size_bytes() noexcept
Number of contiguous bytes for the list data,.
void operator=(const UList< T > &list)
Assignment to UList operator. Takes linear time.
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
static constexpr label size() noexcept
Return the number of elements in the FixedList.
const T * const_iterator
Random access iterator for traversing FixedList.
const_iterator cbegin() const noexcept
void checkIndex(const label i) const
Check index is within valid range [0,N).
void fill(const T &val)
Assign all entries to the given value.
T * iterator
Random access iterator for traversing FixedList.
std::reverse_iterator< const_iterator > const_reverse_iterator
Reverse iterator (const access).
bool contains(const T &val) const
True if the value is contained in the list.
const T & rcValue(const label i) const
Return reverse circular value (ie, previous value in the list).
T & get() noexcept
Element access using compile-time indexing.
const_reverse_iterator crend() const
Return const_reverse_iterator to end reverse traversing FixedList.
void transfer(FixedList< T, N > &list)
Transfer by swapping using a move assignment for the content of the individual list elements.
const T * cdata() const noexcept
Return pointer to the underlying array serving as data storage.
T & back() noexcept
Access last element of the list, position [N-1].
void resize(const label n)
Dummy function, to make FixedList consistent with List Any resizing is ignored (Fatal with bad sizing...
iterator end() noexcept
Return an iterator to end traversing the FixedList.
const T & fcValue(const label i) const
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 ...
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator (non-const access).
T * data() noexcept
Return pointer to the underlying array serving as data storage.
bool uniform() const
True if all entries have identical values, and list is non-empty.
void checkSize(const label size) const
Check size is identical to template parameter N.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
T & front() noexcept
Access first element of the list, position [0].
reverse_iterator rbegin()
Return reverse_iterator to begin reverse traversing the FixedList.
T & operator[](const label i)
Return element of FixedList.
FixedList()=default
Default construct.
reverse_iterator rend()
Return reverse_iterator to end reverse traversing the FixedList.
label find(const T &val) const
static constexpr bool empty() noexcept
Always false since zero-sized FixedList is compile-time disabled.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
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.
void checkStart(const label start) const
Check start is within valid range [0,size).
autoPtr< FixedList< T, N > > clone() const
Clone.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
iterator begin() noexcept
Return an iterator to begin traversing the UList.
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedScalar pos(const dimensionedScalar &ds)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
Exchange contents of lists - see DynamicList::swap().
errorManip< error > abort(error &err)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const Vector< label > N(dict.get< Vector< label > >("N"))