Go to the documentation of this file.
43 #include <initializer_list>
55 template<
class LListBase,
class T>
class LList;
57 template<
class LListBase,
class T>
64 template<
class LListBase,
class T>
76 template<
class LListBase,
class T>
110 class const_iterator;
119 public LListBase::link
138 static constexpr
T*
ptr(
typename LListBase::link* node)
140 return &(
static_cast<link*
>(node)->
obj_);
144 static constexpr
const T*
ptr(
const typename LListBase::link* node)
146 return &(
static_cast<const link*
>(node)->
obj_);
150 static constexpr
T&
ref(
typename LListBase::link* node)
152 return static_cast<link*
>(node)->
obj_;
156 static constexpr
const T&
ref(
const typename LListBase::link* node)
158 return static_cast<const link*
>(node)->
obj_;
169 explicit LList(
const T& item)
177 this->
insert(std::move(item));
190 LList(std::initializer_list<T> lst);
253 auto p = LListBase::removeHead();
262 auto p = LListBase::remove(item);
271 auto p = LListBase::remove(iter);
295 void operator=(std::initializer_list<T> lst);
305 friend Istream&
operator>> <LListBase,
T>
313 friend Ostream& operator<< <LListBase, T>
495 inline iterator
begin()
497 return LListBase::template iterator_first<base_iterator>();
501 inline const_iterator
cbegin()
const
503 return LListBase::template iterator_first<const_base_iterator>();
507 inline reverse_iterator
rbegin()
509 return LListBase::template iterator_last<base_iterator>();
513 inline const_reverse_iterator
crbegin()
const
515 return LListBase::template iterator_last<const_base_iterator>();
519 inline const_iterator
begin()
const
525 inline const_reverse_iterator
rbegin()
const
532 inline const iterator&
end()
534 return LListBase::template iterator_end<iterator>();
538 inline const const_iterator&
cend()
const
540 return LListBase::template iterator_end<const_iterator>();
544 inline const reverse_iterator&
rend()
546 return LListBase::template iterator_rend<reverse_iterator>();
550 inline const const_reverse_iterator&
crend()
const
552 return LListBase::template iterator_rend<const_reverse_iterator>();
556 inline const const_iterator&
end()
const
562 inline const const_reverse_iterator&
rend()
const
void append(const T &item)
Add copy at tail of list.
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
T remove(iterator &iter)
Remove and return element specified by iterator.
reference first()
The first entry in the list.
const typedef T & const_reference
Const reference for value_type.
const_reference operator*() const
static constexpr T * ptr(typename LListBase::link *node)
Dereference LListBase::link to obtain address of stored object.
link(const T &obj)
Copy construct from given object.
static constexpr T & ref(typename LListBase::link *node)
Dereference LListBase::link to obtain the stored object.
reverse_iterator rbegin()
Iterator to last item in list with non-const access.
reference operator*() const
pointer operator->() const
An STL-conforming iterator.
const const_iterator & end() const
End of list for forward iterators.
const_reverse_iterator & operator++()
label size_type
The type that can represent the container size.
const_iterator begin() const
Iterator to first item in list with const access.
void clear()
Delete contents of list.
LList(const T &item)
Construct and copy insert the initial T item.
typename Foam::string ::iterator base_iterator
const const_reverse_iterator & rend() const
End of list for reverse iterators.
const iterator & end()
End of list for forward iterators.
Template class for non-intrusive linked lists.
const_iterator & operator--()
typename Foam::string ::const_iterator const_base_iterator
static constexpr const T * ptr(const typename LListBase::link *node)
Dereference LListBase::link to obtain address of stored object.
void insert(T &&item)
Move construct at head of list.
reference operator*() const
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void operator=(const LList< LListBase, T > &lst)
Copy assignment.
const_reverse_iterator(const_base_iterator iter)
Construct from base iterator.
iterator begin()
Iterator to first item in list with non-const access.
pointer operator->() const
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
reference operator()() const
T & reference
Reference for value_type.
const_pointer operator->() const
const_reverse_iterator & operator--()
link(T &&obj)
Move construct from given object.
const_reference last() const
The last entry in the list (const access)
LList(T &&item)
Construct and move insert the initial T item.
reverse_iterator & operator--()
void append(T &&item)
Move construct at tail of list.
label difference_type
The difference between iterator objects.
The storage of T with linked nodes.
constexpr auto cbegin(const C &c) -> decltype(c.begin())
Return const_iterator to the beginning of the container c.
const_iterator(base_iterator iter)
Construct from base iterator.
const const_iterator & cend() const
End of list for forward iterators.
const const_reverse_iterator & crend() const
End of list for reverse iterators.
iterator(base_iterator iter)
Construct from base iterator.
const_reverse_iterator rbegin() const
Iterator to last item in list with const access.
static constexpr const T & ref(const typename LListBase::link *node)
Dereference LListBase::link to obtain the stored object.
reverse_iterator(base_iterator iter)
Construct from base iterator.
const_reverse_iterator crbegin() const
Iterator to last item in list with const access.
reverse_iterator & operator++()
const_pointer operator->() const
const typedef T * const_pointer
Const pointer for value_type.
reference last()
The last entry in the list.
T * pointer
Pointer for value_type.
const_iterator cbegin() const
Iterator to first item in list with const access.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
const reverse_iterator & rend()
End of list for reverse iterators.
LList()=default
Null construct.
void transfer(LList< LListBase, T > &lst)
Transfer the contents of the argument into this List.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
const_reference first() const
The first entry in the list (const access)
const_iterator(const_base_iterator iter)
Construct from base iterator.
const_reference operator*() const
void insert(const T &item)
Add copy at head of list.
An STL-conforming const_iterator.
T remove(link *item)
Remove and return element.
T value_type
Type of values stored.
T removeHead()
Remove and return head.
const_reference operator()() const
const_iterator & operator++()
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write LList with line-breaks when length exceeds shortLen.