Go to the documentation of this file.
35 template<
class T,
unsigned N>
38 return NullObjectRef<FixedList<T, N>>();
44 template<
class T,
unsigned N>
51 template<
class T,
unsigned N>
58 template<
class T,
unsigned N>
61 for (
unsigned i=0; i<
N; ++i)
68 template<
class T,
unsigned N>
71 for (
unsigned i=0; i<
N; ++i)
78 template<
class T,
unsigned N>
81 for (
unsigned i=0; i<
N; ++i)
83 v_[i] = std::move(list.v_[i]);
88 template<
class T,
unsigned N>
91 checkSize(list.size());
93 auto iter = list.begin();
94 for (
unsigned i=0; i<
N; ++i)
102 template<
class T,
unsigned N>
105 checkSize(list.
size());
107 for (
unsigned i=0; i<
N; ++i)
114 template<
class T,
unsigned N>
115 template<
unsigned AnyNum>
122 for (
unsigned i=0; i<
N; ++i)
124 v_[i] = list[indices[i]];
129 template<
class T,
unsigned N>
136 for (
unsigned i=0; i<
N; ++i)
138 v_[i] = list[indices[i]];
143 template<
class T,
unsigned N>
146 checkSize(list.size());
148 auto iter = list.
begin();
149 for (
unsigned i=0; i<
N; ++i)
157 template<
class T,
unsigned N>
167 template<
class T,
unsigned N>
175 template<
class T,
unsigned N>
183 template<
class T,
unsigned N>
187 return reinterpret_cast<const char*
>(v_);
191 template<
class T,
unsigned N>
195 return reinterpret_cast<char*
>(v_);
199 template<
class T,
unsigned N>
206 template<
class T,
unsigned N>
213 template<
class T,
unsigned N>
220 template<
class T,
unsigned N>
227 template<
class T,
unsigned N>
234 template<
class T,
unsigned N>
237 return (i ==
N-1 ? 0 : i+1);
241 template<
class T,
unsigned N>
244 return this->operator[](this->fcIndex(i));
248 template<
class T,
unsigned N>
251 return this->operator[](this->fcIndex(i));
255 template<
class T,
unsigned N>
258 return (i ? i-1 :
N-1);
262 template<
class T,
unsigned N>
265 return this->operator[](this->rcIndex(i));
269 template<
class T,
unsigned N>
272 return this->operator[](this->rcIndex(i));
276 template<
class T,
unsigned N>
279 if (start < 0 || (start &&
unsigned(start) >=
N))
283 <<
"start " << start <<
" out of range [0," <<
N <<
")"
289 template<
class T,
unsigned N>
292 if (
unsigned(size) !=
N)
295 <<
"size " << size <<
" != " <<
N
301 template<
class T,
unsigned N>
304 if (i < 0 ||
unsigned(i) >=
N)
307 <<
"index " << i <<
" out of range [0," <<
N <<
")"
313 template<
class T,
unsigned N>
316 if (empty())
return false;
318 for (
unsigned i=1; i<
N; ++i)
330 template<
class T,
unsigned N>
337 return (this->
find(val,
pos) >= 0);
341 template<
class T,
unsigned N>
350 template<
class T,
unsigned N>
359 template<
class T,
unsigned N>
362 for (
unsigned i=0; i<
N; ++i)
369 template<
class T,
unsigned N>
372 for (
unsigned i=0; i<
N; ++i)
379 template<
class T,
unsigned N>
387 for (
unsigned i=0; i<
N; ++i)
394 template<
class T,
unsigned N>
402 for (
unsigned i=0; i<
N; ++i)
404 v_[i] = std::move(list[i]);
411 template<
class T,
unsigned N>
421 template<
class T,
unsigned N>
431 template<
class T,
unsigned N>
434 for (
unsigned i=0; i<
N; ++i)
440 template<
class T,
unsigned N>
443 checkSize(list.
size());
445 for (
unsigned i=0; i<
N; ++i)
451 template<
class T,
unsigned N>
454 checkSize(list.size());
456 auto iter = list.
begin();
457 for (
unsigned i=0; i<
N; ++i)
464 template<
class T,
unsigned N>
467 checkSize(list.size());
469 auto iter = list.begin();
470 for (
unsigned i=0; i<
N; ++i)
477 template<
class T,
unsigned N>
484 template<
class T,
unsigned N>
491 template<
class T,
unsigned N>
499 for (
unsigned i=0; i<
N; ++i)
505 template<
class T,
unsigned N>
513 for (
unsigned i=0; i<
N; ++i)
515 v_[i] = std::move(list.v_[i]);
522 template<
class T,
unsigned N>
530 template<
class T,
unsigned N>
538 template<
class T,
unsigned N>
546 template<
class T,
unsigned N>
554 template<
class T,
unsigned N>
562 template<
class T,
unsigned N>
570 template<
class T,
unsigned N>
578 template<
class T,
unsigned N>
586 template<
class T,
unsigned N>
594 template<
class T,
unsigned N>
602 template<
class T,
unsigned N>
610 template<
class T,
unsigned N>
void resize_nocopy(const label n)
Dummy function, to make FixedList consistent with List.
const T & fcValue(const label i) const
Return forward circular value (ie, next value in the list)
autoPtr< FixedList< T, N > > clone() const
Clone.
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
static const FixedList< T, N > & null()
Return a null FixedList.
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
iterator end() noexcept
Return an iterator to end traversing the FixedList.
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant FixedList.
T * data() noexcept
Return pointer to the underlying array serving as data storage.
const_reverse_iterator crbegin() const
Return const_reverse_iterator to begin reverse traversing FixedList.
static constexpr const zero Zero
Global zero (0)
void checkIndex(const label i) const
Check index is within valid range [0,N)
void swap(FixedList< T, N > &other)
Swap lists by swapping the content of the individual list elements.
void transfer(FixedList< T, N > &list)
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
T & last() noexcept
The last element of the list, position [N-1].
const T * cdata() const noexcept
Return pointer to the underlying array serving as data storage.
void checkStart(const label start) const
Check start is within valid range [0,size)
static std::streamsize size_bytes() noexcept
Number of contiguous bytes for the list data,.
void operator=(const T list[N])
Assignment to array operator. Takes linear time.
void resize(const label n)
Dummy function, to make FixedList consistent with List.
void fill(const T &val)
Assign all entries to the given value.
label fcIndex(const label i) const
T & first() noexcept
The first element of the list, position [0].
Template class for non-intrusive linked lists.
iterator begin() noexcept
Return an iterator to begin traversing the FixedList.
T * iterator
Random access iterator for traversing FixedList.
iterator begin()
Iterator to first item in list with non-const access.
const T & rcValue(const label i) const
Return reverse circular value (ie, previous value in the list)
const_reverse_iterator crend() const
Return const_reverse_iterator to end reverse traversing FixedList.
reverse_iterator rend()
Return reverse_iterator to end reverse traversing the FixedList.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
errorManip< error > abort(error &err)
T & operator[](const label i)
Return element of FixedList.
std::reverse_iterator< const_iterator > const_reverse_iterator
Reverse iterator (const access)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
Non-intrusive singly-linked list.
A 1D vector of objects of type <T> with a fixed length <N>.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
FixedList()=default
Default construct.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant FixedList.
void size(const label n)
Older name for setAddressableSize.
const Vector< label > N(dict.get< Vector< label >>("N"))
bool found(const T &val, label pos=0) const
True if the value if found in the list.
void checkSize(const label size) const
Check size is identical to template parameter N.
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator (non-const access)
label rcIndex(const label i) const
reverse_iterator rbegin()
Return reverse_iterator to begin reverse traversing the FixedList.
bool uniform() const
True if all entries have identical values, and list is non-empty.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
dimensionedScalar pos(const dimensionedScalar &ds)