42#ifndef Foam_IndirectListBase_H
43#define Foam_IndirectListBase_H
56template<
class T,
class Addr>
73 template<
class ListType>
74 inline void copyList(
const ListType& rhs);
134 return addr_.empty();
159 inline const T&
first()
const;
165 inline const T&
last()
const;
172 inline label
fcIndex(
const label i)
const;
176 inline label
rcIndex(
const label i)
const;
179 inline const T&
fcValue(
const label i)
const;
185 inline const T&
rcValue(
const label i)
const;
197 label
find(
const T& val, label
pos = 0)
const;
203 label
rfind(
const T& val, label
pos = -1)
const;
208 inline bool found(
const T& val, label
pos=0)
const;
238 template<
class AnyAddr>
250 typename addressing_type::const_iterator iter_;
263 typename addressing_type::const_iterator addrIter
280 return (iter_ == rhs.iter_);
285 return (iter_ != rhs.iter_);
296 typename addressing_type::const_iterator iter_;
309 typename addressing_type::const_iterator addrIter
312 begin_(list.cdata()),
326 return (iter_ == rhs.iter_);
331 return (iter_ != rhs.iter_);
384template<
class T,
class Addr>
A const iterator for an indirect list.
std::forward_iterator_tag iterator_category
bool operator!=(const const_iterator &rhs) const
bool operator==(const const_iterator &rhs) const
const_iterator(const UList< T > &list, typename addressing_type::const_iterator addrIter)
const_iterator & operator++()
reference operator*() const
A non-const iterator for an indirect list.
bool operator!=(const iterator &rhs) const
std::forward_iterator_tag iterator_category
bool operator==(const iterator &rhs) const
reference operator*() const
iterator(UList< T > &list, typename addressing_type::const_iterator addrIter)
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
label size_type
The type to represent the size of a UList.
void copyList(const ListType &rhs)
Deep copy values from the list.
label difference_type
The difference between iterator objects.
T value_type
Type of values the list contains.
label rcIndex(const label i) const
const_iterator begin() const
Return a const_iterator at begin of list.
const_iterator cbegin() const
Return a const_iterator at begin of list.
void operator=(const T &val)
Assign all addressed elements to the given value.
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
const T & rcValue(const label i) const
Return reverse circular value (ie, previous value in the list)
label fcIndex(const label i) const
const T * const_pointer
The pointer type for const access to value_type items.
T * pointer
The pointer type for non-const access to value_type items.
label rfind(const T &val, label pos=-1) const
Find index of the last occurrence of the value.
const T & last() const
The last element of the list.
const Addr & addressing() const noexcept
The addressing used for the list.
const T & fcValue(const label i) const
Return forward circular value (ie, next value in the list)
IndirectListBase()=delete
No default construct.
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
const_iterator cend() const
Return a const_iterator at end of list.
T & reference
The type used for storing into value_type objects.
const T & first() const
The first element of the list.
bool uniform() const
True if all entries have identical values, and list is non-empty.
const UList< T > & values() const noexcept
The list of values (without addressing)
label size() const noexcept
The number of elements in the list.
UList< T > & values() noexcept
The list of values (without addressing)
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
iterator end()
Return an iterator at end of list.
const_iterator end() const
Return a const_iterator at end of list.
List< T > operator()() const
Return the addressed elements as a List.
iterator begin()
Return an iterator at begin of list.
Addr addressing_type
The addressing type (non-stl definition)
T & operator[](const label i)
Non-const access to an element in the list.
const T & const_reference
The type used for reading from constant value_type objects.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const_iterator cend() const noexcept
Return const_iterator to end traversing the constant UList.
const_iterator cbegin() const noexcept
Return const_iterator to begin traversing the constant UList.
Database for solution data, solver performance and other reduced data.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
OBJstream os(runTime.globalPath()/outputName)
dimensionedScalar pos(const dimensionedScalar &ds)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Number of items before requiring line-breaks in the list output.