42#ifndef Foam_IndirectListBase_H
43#define Foam_IndirectListBase_H
56template<
class T,
class Addr>
73 template<
class ListType>
145 inline const T&
front()
const;
151 inline const T&
back()
const;
162 inline label
rcIndex(
const label i)
const;
165 inline const T&
fcValue(
const label i)
const;
171 inline const T&
rcValue(
const label i)
const;
187 inline bool contains(
const T& val, label
pos = 0, label len = -1)
const;
194 label
find(
const T& val, label
pos = 0, label len = -1)
const;
200 label
rfind(
const T& val, label
pos = -1)
const;
230 template<
class AnyAddr>
242 typename addressing_type::const_iterator iter_;
255 typename addressing_type::const_iterator addrIter
272 return (iter_ ==
rhs.iter_);
277 return (iter_ !=
rhs.iter_);
288 typename addressing_type::const_iterator iter_;
300 const UList<T>&
list,
301 typename addressing_type::const_iterator addrIter
304 begin_(
list.cdata()),
318 return (iter_ ==
rhs.iter_);
323 return (iter_ !=
rhs.iter_);
333 return iterator(values_, addr_.cbegin());
390 bool found(
const T& val, label
pos = 0)
const
401template<
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....
bool contains(const T &val, label pos=0, label len=-1) const
Is the value contained in the list?
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 & first()
Access first element of the list, position [0].
bool found(const T &val, label pos=0) const
Same as contains().
T value_type
Type of values the list contains.
label rcIndex(const label i) const
The reverse circular index. The previous index in the list which returns to the last at the beginning...
const_iterator begin() const
Return a const_iterator at begin of list.
const T & front() const
The first element of the 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
The forward circular index. The next index in the list which returns to the first at the end of the l...
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
Access last element of the list, position [size()-1].
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.
const T & back() const
The last element of the list.
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
Access first element of the list.
bool uniform() const
True if all entries have identical values, and list is non-empty.
List< T > list() const
Return the addressed elements as a List.
const UList< T > & values() const noexcept
The list of values (without addressing).
label find(const T &val, label pos=0, label len=-1) const
Find index of the first occurrence of the value.
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.
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.
T & last()
Access last element of the list, position [size()-1].
List< T > operator()() const
Return the addressed elements as a 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...
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).
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Number of items before requiring line-breaks in the list output.