Go to the documentation of this file.
43 #ifndef IndirectListBase_H
44 #define IndirectListBase_H
57 template<
class T,
class Addr>
74 template<
class ListType>
75 inline void copyList(
const ListType& rhs);
107 class const_iterator;
133 inline bool empty()
const
135 return addr_.empty();
144 return values_[addr_.first()];
148 inline const T&
first()
const
150 return values_[addr_.first()];
156 return values_[addr_.last()];
160 inline const T&
last()
const
162 return values_[addr_.last()];
229 template<
class AnyAddr>
239 typename addressing_type::const_iterator iter_;
252 typename addressing_type::const_iterator baseIter
261 return data_[*iter_];
272 return iter_ == rhs.iter_;
277 return (iter_ != rhs.iter_);
286 typename addressing_type::const_iterator iter_;
299 typename addressing_type::const_iterator baseIter
308 return data_[*iter_];
319 return iter_ == rhs.iter_;
324 return iter_ != rhs.iter_;
332 inline iterator
begin()
334 return iterator(values_, addr_.
cbegin());
338 inline iterator
end()
340 return iterator(values_, addr_.
cend());
347 inline const_iterator
cbegin()
const
349 return const_iterator(values_, addr_.
cbegin());
353 inline const_iterator
cend()
const
355 return const_iterator(values_, addr_.
cend());
359 inline const_iterator
begin()
const
365 inline const_iterator
end()
const
383 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.
label ListType::const_reference val
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
bool found(const T &val, const label start=0) const
True if the value if found in the list. Linear search.
iterator(UList< T > &list, typename addressing_type::const_iterator baseIter)
void copyList(const ListType &rhs)
Copy values The number of elements in the list.
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.
T & reference
The type used for storing into value_type objects.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
IndirectListBase()=delete
No null construct.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Number of items before requiring line-breaks in the list ouput.
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
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...
label ListType::const_reference const label start
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...
label find(const T &val, const label start=0) const
Find index of the first occurrence of the value.
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.
Ostream & operator<<(Ostream &, const boundaryPatch &)
const_iterator cbegin() const
Return a const_iterator at begin of list.
label size() const
The number of elements in the list.
label rfind(const T &val, const label pos=-1) const
Find index of the last occurrence of the value.
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
label difference_type
The difference between iterator objects.
dimensionedScalar pos(const dimensionedScalar &ds)