Go to the documentation of this file.
42 #ifndef IndirectListBase_H
43 #define IndirectListBase_H
56 template<
class T,
class Addr>
73 template<
class ListType>
74 inline void copyList(
const ListType& rhs);
126 inline label
size()
const
132 inline bool empty()
const
134 return addr_.empty();
143 return values_[addr_.first()];
147 inline const T&
first()
const
149 return values_[addr_.first()];
155 return values_[addr_.last()];
159 inline const T&
last()
const
161 return values_[addr_.last()];
189 label
find(
const T& val, label
pos = 0)
const;
195 label
rfind(
const T& val, label
pos = -1)
const;
200 inline bool found(
const T& val, label
pos=0)
const;
230 template<
class AnyAddr>
240 typename addressing_type::const_iterator iter_;
253 typename addressing_type::const_iterator baseIter
262 return data_[*iter_];
273 return iter_ == rhs.iter_;
278 return (iter_ != rhs.iter_);
287 typename addressing_type::const_iterator iter_;
300 typename addressing_type::const_iterator baseIter
309 return data_[*iter_];
320 return iter_ == rhs.iter_;
325 return iter_ != rhs.iter_;
384 template<
class T,
class Addr>
const_iterator cbegin() const
Return const_iterator to begin traversing the constant UList.
const typedef T * const_pointer
The pointer type for const access to value_type items.
iterator end()
Return an iterator at end of list.
T value_type
Type of values the list contains.
const_iterator & operator++()
List< T > operator()() const
Return the addressed elements as a List.
const_iterator cend() const
Return const_iterator to end traversing the constant UList.
reference operator*() const
iterator(UList< T > &list, typename addressing_type::const_iterator baseIter)
void copyList(const ListType &rhs)
Deep copy values from the list.
label rfind(const T &val, label pos=-1) const
Find index of the last occurrence of the value.
const typedef T & const_reference
The type used for reading from constant value_type objects.
const_iterator(const UList< T > &list, typename addressing_type::const_iterator baseIter)
const Addr & addressing() const
The addressing used for the list.
bool empty() const
True if the list is empty (ie, size() is zero).
bool operator!=(const_iterator &rhs) const
reference operator*() const
const UList< T > & values() const
The list of values (without addressing)
bool operator==(const_iterator &rhs) const
T * pointer
The pointer type for non-const access to value_type items.
A non-const iterator for an indirect list.
iterator begin()
Return an iterator to begin traversing the UList.
T & operator[](const label i)
Non-const access to an element in the list.
T & first()
The first element of the list.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
T & reference
The type used for storing into value_type objects.
IndirectListBase()=delete
No default construct.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Number of items before requiring line-breaks in the list output.
std::forward_iterator_tag iterator_category
UList< T > & values()
The list of values (without addressing)
bool operator==(iterator &rhs) const
Addr addressing_type
The addressing type (non-stl definition)
std::forward_iterator_tag iterator_category
label find(const T &val, label pos=0) const
Find index of the first occurrence of the value.
const_iterator end() const
Return a const_iterator at end of list.
bool operator!=(iterator &rhs) const
iterator begin()
Return an iterator at begin of list.
label size_type
The type to represent the size of a UList.
const T & last() const
The last element of the list.
T & last()
The last element of the list.
const_iterator cend() const
Return a const_iterator at end of list.
bool uniform() const
True if all entries have identical values, and list is non-empty.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const T & first() const
The first element of the list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const_iterator begin() const
Return a const_iterator at end of list.
void operator=(const T &val)
Assign all addressed elements to the given value.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
T * pointer
The pointer type for non-const access to value_type items.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List, with line-breaks in ASCII when length exceeds shortLen.
A const iterator for an indirect list.
const_iterator cbegin() const
Return a const_iterator at begin of list.
label size() const
The number of elements in the list.
bool found(const T &val, label pos=0) const
True if the value if found in the list.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
label difference_type
The difference between iterator objects.
dimensionedScalar pos(const dimensionedScalar &ds)