Go to the documentation of this file.
54 #include <initializer_list>
56 #include <type_traits>
66 template<
class T,
unsigned N>
class FixedList;
67 template<
class T>
class UList;
69 template<
class T,
unsigned N>
70 Istream&
operator>>(Istream& is, FixedList<T, N>& list);
72 template<
class T,
unsigned N>
73 Ostream&
operator<<(Ostream&
os,
const FixedList<T, N>& list);
80 template<
class T,
unsigned N>
86 "Size must be positive (non-zero) and fit as a signed int value"
169 inline FixedList(std::initializer_list<T> list);
175 template<
unsigned AnyNum>
204 inline const T*
cdata() const noexcept;
207 inline
T*
data() noexcept;
221 inline
T&
first() noexcept;
224 inline const
T&
first() const noexcept;
227 inline
T&
last() noexcept;
230 inline const
T&
last() const noexcept;
234 inline static std::streamsize
size_bytes() noexcept;
242 inline label
fcIndex(const label i) const;
245 inline const
T&
fcValue(const label i) const;
252 inline label
rcIndex(const label i) const;
255 inline const
T&
rcValue(const label i) const;
264 inline
void checkStart(const label start) const;
282 label
find(const
T& val, label
pos = 0) const;
288 label
rfind(const
T& val, label
pos = -1) const;
293 inline
bool found(const
T& val, label
pos = 0) const;
299 inline
void resize(const label
n);
308 inline void fill(
const T& val);
348 inline void operator=(std::initializer_list<T> list);
414 static constexpr
bool empty() noexcept {
return !
N; }
417 static constexpr label
size() noexcept {
return N; }
420 static constexpr
unsigned max_size() noexcept {
return N; }
423 inline void swap(FixedList<T, N>& other);
431 bool operator==(
const FixedList<T, N>& list)
const;
434 bool operator!=(
const FixedList<T, N>& list)
const;
437 bool operator<(
const FixedList<T, N>& list)
const;
440 bool operator>(
const FixedList<T, N>& list)
const;
443 bool operator<=(
const FixedList<T, N>& list)
const;
446 bool operator>=(
const FixedList<T, N>& list)
const;
455 void writeEntry(
const word& keyword, Ostream&
os)
const;
459 Ostream&
writeList(Ostream&
os,
const label shortLen=0)
const;
465 friend Istream&
operator>> <
T,
N>
468 FixedList<T, N>& list
477 inline unsigned operator()
485 return Foam::Hasher(obj.cdata(), obj.size_bytes(), seed);
489 for (
const T& val : obj)
491 seed = op(val, seed);
499 template<
class Unused=
bool>
510 template<
class T,
unsigned N>
514 template<
class T,
unsigned N>
518 template<
class T,
unsigned N>
522 template<
class T,
unsigned N>
530 template<
class T,
unsigned N>
540 template<
class T,
unsigned N>
543 return list.readList(is);
549 template<
class T,
unsigned N>
void resize_nocopy(const label n)
const T & fcValue(const label i) const
autoPtr< FixedList< T, N > > clone() const
Istream & readList(Istream &is)
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
A class for handling words, derived from Foam::string.
void writeEntry(Ostream &os) const
void swapLast(const label i)
const_iterator cend() const noexcept
const_reverse_iterator crbegin() const
void checkIndex(const label i) const
void swap(FixedList< T, N > &other)
unsigned Hasher(const void *data, size_t len, unsigned seed=0)
void transfer(FixedList< T, N > &list)
const char * cdata_bytes() const noexcept
bool operator<=(const FixedList< T, N > &list) const
const typedef T * const_pointer
static constexpr unsigned max_size() noexcept
const T * cdata() const noexcept
void checkStart(const label start) const
static std::streamsize size_bytes() noexcept
static constexpr label size() noexcept
label find(const T &val, label pos=0) const
Istream & operator>>(Istream &, directionInfo &)
void operator=(const T list[N])
bool operator!=(const FixedList< T, N > &list) const
void resize(const label n)
label fcIndex(const label i) const
A template class to specify if a data type is composed solely of Foam::label elements.
Swap arguments as per std::swap, but in Foam namespace.
Template class for non-intrusive linked lists.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
bool operator==(const FixedList< T, N > &list) const
Forward declarations for SLList.
bool operator<(const FixedList< T, N > &list) const
const dimensionedScalar b
label rfind(const T &val, label pos=-1) const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
static std::streamsize byteSize()
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
const T & rcValue(const label i) const
const typedef T & const_reference
label max(const labelHashSet &set, label maxValue=labelMin)
const_reverse_iterator crend() const
void moveFirst(const label i)
OBJstream os(runTime.globalPath()/outputName)
void setSize(const label n)
T & operator[](const label i)
A template class to specify if a data type is composed solely of Foam::scalar elements.
std::reverse_iterator< const_iterator > const_reverse_iterator
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
char * data_bytes() noexcept
bool operator>(const FixedList< T, N > &list) const
Ostream & writeList(Ostream &os, const label shortLen=0) const
bool operator>=(const FixedList< T, N > &list) const
void swapFirst(const label i)
A 1D vector of objects of type <T> with a fixed length <N>.
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
const_iterator cbegin() const noexcept
iterator begin() noexcept
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const Vector< label > N(dict.get< Vector< label >>("N"))
const typedef T * const_iterator
static constexpr bool empty() noexcept
bool found(const T &val, label pos=0) const
void checkSize(const label size) const
std::reverse_iterator< iterator > reverse_iterator
label rcIndex(const label i) const
Database for solution data, solver performance and other reduced data.
reverse_iterator rbegin()
A template class to specify that a data type can be considered as being contiguous in memory.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
void moveLast(const label i)
dimensionedScalar pos(const dimensionedScalar &ds)