51template<
class LListBase,
class T>
class LList;
53template<
class LListBase,
class T>
60template<
class LListBase,
class T>
72template<
class LListBase,
class T>
115 public LListBase::link
129 val_(std::move(elem))
134 static T remove(
typename LListBase::link* node)
137 T val(std::move(
p->val_));
143 static constexpr T*
ptr(
typename LListBase::link* node)
145 return &(
static_cast<link*
>(node)->val_);
149 static constexpr const T*
ptr(
const typename LListBase::link* node)
151 return &(
static_cast<const link*
>(node)->
val_);
155 static constexpr T&
ref(
typename LListBase::link* node)
157 return static_cast<link*
>(node)->
val_;
161 static constexpr const T&
ref(
const typename LListBase::link* node)
163 return static_cast<const link*
>(node)->
val_;
174 explicit LList(
const T& elem)
195 LList(std::initializer_list<T> lst);
232 LListBase::push_front(
new link(elem));
238 LListBase::push_front(
new link(std::move(elem)));
244 LListBase::push_back(
new link(elem));
250 LListBase::push_back(
new link(std::move(elem)));
304 friend Istream&
operator>> <LListBase,
T>
381 const_base_iterator(iter)
457 class const_reverse_iterator
496 return LListBase::template iterator_first<base_iterator>();
502 return LListBase::template iterator_first<const_base_iterator>();
508 return LListBase::template iterator_last<base_iterator>();
512 inline const_reverse_iterator
crbegin()
const
514 return LListBase::template iterator_last<const_base_iterator>();
520 return LListBase::cbegin();
533 return LListBase::template iterator_end<iterator>();
539 return LListBase::template iterator_end<const_iterator>();
545 return LListBase::template iterator_rend<reverse_iterator>();
551 return LListBase::template iterator_rend<const_reverse_iterator>();
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An STL-conforming const_iterator.
const_pointer operator->() const
const_reference operator()() const
const_iterator(base_iterator iter)
Construct from base iterator.
const_iterator & operator++()
const_iterator(const_base_iterator iter)
Construct from base iterator.
const_reference operator*() const
const_iterator & operator--()
A const_reverse_iterator, for LListBase classes that support reverse iteration.
const_pointer operator->() const
const_reverse_iterator(const_base_iterator iter)
Construct from base iterator.
const_reverse_iterator & operator--()
const_reverse_iterator & operator++()
const_reference operator*() const
An STL-conforming iterator.
reference operator()() const
reference operator*() const
iterator(base_iterator iter)
Construct from base iterator.
pointer operator->() const
A reverse_iterator, for LListBase classes that support reverse iteration.
reverse_iterator & operator++()
reference operator*() const
reverse_iterator(base_iterator iter)
Construct from base iterator.
reverse_iterator & operator--()
pointer operator->() const
Template class for non-intrusive linked lists.
typename LListBase::iterator base_iterator
label size_type
The type that can represent the container size.
void pop_front(label n=1)
Remove first element(s) from the list (deletes pointers).
const_reference front() const
The first entry in the list (const access).
void push_front(const T &elem)
Add copy at front of list.
const iterator & end()
End of list for forward iterators.
label difference_type
The difference between iterators.
void prepend(const T &elem)
Add copy at front of list.
T value_type
Type of values stored.
const_iterator begin() const
Iterator to first item in list with const access.
const const_iterator & end() const
End of list for forward iterators.
typename LListBase::const_iterator const_base_iterator
LList()=default
Default construct.
const_iterator cbegin() const
Iterator to first item in list with const access.
void transfer(LList< LListBase, T > &lst)
Transfer the contents of the argument into this List and annul the argument list.
LList(T &&elem)
Construct and move add initial item.
const const_iterator & cend() const
End of list for forward iterators.
const T * const_pointer
Const pointer for value_type.
void append(T &&elem)
Move construct at back of list.
LList(std::initializer_list< T > lst)
Copy construct from an initializer list.
const_reference back() const
The last entry in the list (const access).
LList(const T &elem)
Construct and copy add initial item.
LList(LList< LListBase, T > &&lst)
Move construct.
T * pointer
Pointer for value_type.
reference front()
The first entry in the list.
void operator=(std::initializer_list< T > lst)
Copy assignment from an initializer list.
const_reverse_iterator crbegin() const
Iterator to last item in list with const access.
LList(Istream &is)
Construct from Istream.
T remove(iterator &iter)
Remove and return element specified by iterator.
const reverse_iterator & rend()
End of list for reverse iterators.
T removeHead()
Remove and return first entry.
T & reference
Reference for value_type.
reference last()
The last entry in the list.
void push_front(T &&elem)
Move construct at front of list.
void insert(const T &elem)
Add copy at front of list. Same as push_front().
friend Ostream & operator(Ostream &os, const LList< LListBase, T > &lst)
Write LList to Ostream with line breaks, as per writeList with shortLen=-1.
void insert(T &&elem)
Move construct at front of list. Same as push_front().
const const_reverse_iterator & crend() const
End of list for reverse iterators.
const_reference first() const
The first entry in the list (const access).
void push_back(const T &elem)
Add copy at back of list.
const_reference last() const
The last entry in the list (const access).
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write LList with line-breaks when length exceeds shortLen.
void prepend(T &&elem)
Move construct at front of list.
void clear()
Delete contents of list.
reverse_iterator rbegin()
Iterator to last item in list with non-const access.
const const_reverse_iterator & rend() const
End of list for reverse iterators.
Istream & readList(Istream &is)
Read list from Istream.
iterator begin()
Iterator to first item in list with non-const access.
void append(const T &elem)
Add copy at back of list.
LList(const LList< LListBase, T > &lst)
Copy construct.
~LList()
Destructor. Calls clear().
reference first()
The first entry in the list.
void operator=(LList< LListBase, T > &&lst)
Move assignment.
void operator=(const LList< LListBase, T > &lst)
Copy assignment.
const_reverse_iterator rbegin() const
Iterator to last item in list with const access.
void push_back(T &&elem)
Move construct at back of list.
reference back()
The last entry in the list.
const T & const_reference
Const reference for value_type.
T remove(link *item)
Remove and return element.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
nonInt insert("surfaceSum(((S|magSf)*S)")
Includes some common C++ headers, defines global macros and templates used in multiple places by Open...
The storage of T with linked nodes.
static constexpr T & ref(typename LListBase::link *node)
Dereference LListBase::link to obtain the stored object.
static T remove(typename LListBase::link *node)
Delete linked item and return the element value.
static constexpr const T * ptr(const typename LListBase::link *node)
Dereference LListBase::link to obtain address of stored object.
link(const T &elem)
Copy construct from given object.
static constexpr T * ptr(typename LListBase::link *node)
Dereference LListBase::link to obtain address of stored object.
static constexpr const T & ref(const typename LListBase::link *node)
Dereference LListBase::link to obtain the stored object.
link(T &&elem)
Move construct from given object.