Go to the documentation of this file.
60 #include <initializer_list>
62 #include <type_traits>
75 template<
class T>
class List;
76 template<
class T>
class SubList;
77 template<
class T>
class UList;
78 template<
class T,
class Addr>
class IndirectListBase;
173 friend class List<
T>;
182 inline static const UList<T>&
null();
197 bool operator()(
const label a,
const label
b)
const
213 bool operator()(
const label a,
const label
b)
const
223 UList(
const UList<T>&) =
default;
229 inline constexpr
UList() noexcept;
232 inline
UList(
T* __restrict__ v, const label len) noexcept;
241 inline label
fcIndex(const label i) const noexcept;
245 inline label
rcIndex(const label i) const noexcept;
248 inline const
T&
fcValue(const label i) const;
254 inline const
T&
rcValue(const label i) const;
260 inline const
T*
cdata() const noexcept;
263 inline
T*
data() noexcept;
279 inline const
T&
first() const;
285 inline const
T&
last() const;
289 inline std::streamsize
size_bytes() const noexcept;
299 inline
void checkStart(const label start) const;
305 inline
void checkRange(const label start, const label len) const;
320 label
find(const
T& val, label
pos = 0) const;
326 label
rfind(const
T& val, label
pos = -1) const;
332 inline
bool found(const
T& val, label
pos = 0) const;
360 void deepCopy(const IndirectListBase<
T, Addr>& list);
366 SubList<
T>
slice(const label
pos, label len = -1);
369 const SubList<
T>
slice(const label
pos, label len = -1) const;
379 const SubList<
T>
slice(const labelRange&
range) const;
385 inline
T& operator[](const label i);
390 inline const
T& operator[](const label i) const;
393 inline operator const
Foam::List<
T>&() const;
396 void operator=(const
T& val);
399 void operator=(const
Foam::zero);
453 inline label
size() const noexcept;
456 inline
bool empty() const noexcept;
517 template<
class TypeT = T>
518 typename std::enable_if<std::is_same<bool, TypeT>::value,
bool>
::type
519 inline test(
const label i)
const
521 return (i >= 0 && i < size_ && v_[i]);
527 template<
class TypeT = T>
528 typename std::enable_if<std::is_same<bool, TypeT>::value,
bool>
::type
529 inline get(
const label i)
const
531 return (i >= 0 && i < size_ && v_[i]);
537 template<
class TypeT = T>
538 typename std::enable_if<std::is_same<bool, TypeT>::value,
bool>
::type
539 inline unset(
const label i)
541 if (i >= 0 && i < size_ && v_[i])
555 inline unsigned operator()
563 return Foam::Hasher(obj.cdata(), obj.size_bytes(), seed);
567 for (
const T& val : obj)
569 seed = op(val, seed);
577 template<
class Unused=
bool>
618 return list.writeList(
os, Detail::ListPolicy::short_length<T>::value);
631 template<
class T,
class Compare>
637 template<
class T,
class Compare>
const char * cdata_bytes() const noexcept
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type test(const label i) const
void reverse(UList< T > &list, const label n)
bool operator<(const UList< T > &list) const
less(const UList< T > &list)
void Swap(DynamicList< T, SizeMinA > &a, DynamicList< T, SizeMinB > &b)
const T * cdata() const noexcept
label rcIndex(const label i) const noexcept
A class for handling words, derived from Foam::string.
labelRange validateRange(const labelRange &requestedRange) const
const typedef T & const_reference
bool operator>=(const UList< T > &a) const
constexpr UList() noexcept
unsigned Hasher(const void *data, size_t len, unsigned seed=0)
Ostream & writeList(Ostream &os, const label shortLen=0) const
bool operator==(const UList< T > &a) const
A List obtained as a section of another List.
bool operator<=(const UList< T > &a) const
void setAddressableSize(const label n) noexcept
void checkSize(const label size) const
Istream & operator>>(Istream &, directionInfo &)
SubList< T > slice(const label pos, label len=-1)
void deepCopy(const UList< T > &list)
void swapFirst(const label i)
char * data_bytes() noexcept
label fcIndex(const label i) const noexcept
void stableSort(UList< T > &a)
Swap arguments as per std::swap, but in Foam namespace.
label rfind(const T &val, label pos=-1) const
void checkRange(const label start, const label len) const
void checkStart(const label start) const
Ostream & operator<<(Ostream &, const boundaryPatch &p)
const UList< T > & values
Hash function class. The default definition is for primitives. Non-primitives used to hash entries on...
label operator()(const T &obj) const
const_iterator cend() const noexcept
const dimensionedScalar b
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void swapLast(const label i)
void moveFirst(const label i)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
static constexpr label max_size() noexcept
bool operator!=(const UList< T > &a) const
A range or interval of labels defined by a start and a size.
const_reverse_iterator crend() const
bool operator()(const T &obj) const
bool empty() const noexcept
OBJstream os(runTime.globalPath()/outputName)
FOAM_DEPRECATED_FOR(2021-04, "hasher()") Hash()
const T & fcValue(const label i) const
void writeEntry(Ostream &os) const
UList< char > charUList
A UList of chars.
const_iterator cbegin() const noexcept
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type unset(const label i)
void shallowCopy(const UList< T > &list)
bool operator>(const UList< T > &a) const
void swap(UList< T > &list)
UList< bool > boolUList
A UList of bools.
bool operator()(const label a, const label b) const
Istream & readList(Istream &is)
void shuffle(UList< T > &a)
reverse_iterator rbegin()
const UList< T > & values
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
UList< T > & operator=(const UList< T > &)=delete
fileName::Type type(const fileName &name, const bool followLink=true)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
const typedef T * const_pointer
std::streamsize byteSize() const
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
iterator begin() noexcept
const typedef T * const_iterator
bool operator()(const label a, const label b) const
bool found(const T &val, label pos=0) const
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type get(const label i) const
std::reverse_iterator< const_iterator > const_reverse_iterator
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
UList< label > labelUList
A UList of labels.
void moveLast(const label i)
label find(const T &val, label pos=0) const
std::reverse_iterator< iterator > reverse_iterator
void checkIndex(const label i) const
Database for solution data, solver performance and other reduced data.
greater(const UList< T > &list)
std::streamsize size_bytes() const noexcept
A template class to specify that a data type can be considered as being contiguous in memory.
const T & rcValue(const label i) const
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
const_reverse_iterator crbegin() const
dimensionedScalar pos(const dimensionedScalar &ds)
const T & operator()(const T &obj) const