55template<
class LListBase,
class T>
class LList;
57template<
class LListBase,
class T>
64template<
class LListBase,
class T>
76template<
class LListBase,
class T>
119 public LListBase::link
133 val_(std::move(elem))
138 static T remove(
typename LListBase::link* node)
141 T val(std::move(
p->val_));
147 static constexpr T*
ptr(
typename LListBase::link* node)
149 return &(
static_cast<link*
>(node)->
val_);
153 static constexpr const T*
ptr(
const typename LListBase::link* node)
155 return &(
static_cast<const link*
>(node)->
val_);
159 static constexpr T&
ref(
typename LListBase::link* node)
161 return static_cast<link*
>(node)->
val_;
165 static constexpr const T&
ref(
const typename LListBase::link* node)
167 return static_cast<const link*
>(node)->
val_;
178 explicit LList(
const T& elem)
186 this->
prepend(std::move(elem));
199 LList(std::initializer_list<T> lst);
301 void operator=(std::initializer_list<T> lst);
314 friend Istream&
operator>> <LListBase,
T>
322 friend Ostream& operator<< <LListBase, T>
351 return link::ptr(this->get_node());
401 return link::ptr(this->get_node());
446 return link::ptr(this->get_node());
486 return link::ptr(this->get_node());
506 return LListBase::template iterator_first<base_iterator>();
512 return LListBase::template iterator_first<const_base_iterator>();
518 return LListBase::template iterator_last<base_iterator>();
524 return LListBase::template iterator_last<const_base_iterator>();
543 return LListBase::template iterator_end<iterator>();
549 return LListBase::template iterator_end<const_iterator>();
555 return LListBase::template iterator_rend<reverse_iterator>();
561 return LListBase::template iterator_rend<const_reverse_iterator>();
Forward iterator with non-const access.
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--()
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
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.
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)
bool eraseHead()
Erase the first entry.
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(const T &elem)
Construct and copy add initial item.
T * pointer
Pointer for value_type.
const_reverse_iterator crbegin() const
Iterator to last item in list with const access.
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 insert(const T &elem)
Add copy at front of list. Same as prepend()
void insert(T &&elem)
Move construct at front of list. Same as prepend()
const const_reverse_iterator & crend() const
End of list for reverse iterators.
const_reference first() const
The first entry in the list (const access)
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.
reference first()
The first entry in the list.
void operator=(const LList< LListBase, T > &lst)
Copy assignment.
const_reverse_iterator rbegin() const
Iterator to last item in list with const access.
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,...
unsigned int remove()
Remove and return the last element.
A const_iterator for iterating across on values.
reference ref() const
A reference to the entry (Error if not found)
edgeFaceCirculator cbegin() const
bool append() const noexcept
True if output format uses an append mode.
OBJstream os(runTime.globalPath()/outputName)
Includes some standard C++ headers, defines global macros and templates used in multiple places by Op...
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.
void prepend(const scalar p, label nDiv, scalar expRatio=1)
Add point/divisions/expand to front of list (push_front)