39#ifndef Foam_LPtrList_H
40#define Foam_LPtrList_H
51template<
class LListBase,
class T>
class LPtrList;
53template<
class LListBase,
class T>
60template<
class LListBase,
class T>
72template<
class LListBase,
class T>
75 public LList<LListBase, T*>
163 const T&
back()
const
169 template<
class... Args>
172 T* ptr =
new T(std::forward<Args>(
args)...);
178 template<
class... Args>
181 T* ptr =
new T(std::forward<Args>(
args)...);
223 return parent_type::iterator::operator*();
228 return *(this->
get());
254 parent_type::const_iterator(iter)
265 return parent_type::const_iterator::operator*();
270 return *(this->
get());
291 public parent_type::reverse_iterator
303 return parent_type::reverse_iterator::operator*();
308 return *(this->
get());
329 public parent_type::const_reverse_iterator
335 parent_type::const_reverse_iterator(iter)
341 return parent_type::const_reverse_iterator::operator*();
346 return *(this->
get());
364 return LListBase::template iterator_first<base_iterator>();
370 return LListBase::template iterator_first<const_base_iterator>();
376 return LListBase::template iterator_last<base_iterator>();
380 inline const_reverse_iterator
crbegin()
const
382 return LListBase::template iterator_last<const_base_iterator>();
388 return LListBase::cbegin();
401 return LListBase::template iterator_end<iterator>();
407 return LListBase::template iterator_end<const_iterator>();
413 return LListBase::template iterator_rend<reverse_iterator>();
419 return LListBase::template iterator_rend<const_reverse_iterator>();
423 inline const const_iterator&
end()
const
429 inline const const_reverse_iterator&
rend()
const
437 friend Istream&
operator>> <LListBase,
T>
A helper class when constructing from an Istream or dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
An STL-conforming const_iterator.
An STL-conforming iterator.
void push_front(const T &elem)
void push_back(const T &elem)
An STL-conforming const_iterator.
const_pointer operator->() const
const_reference operator()() const
const_pointer get() const
Return the address of the object being referenced.
const_iterator(base_iterator iter)
const_iterator(const_base_iterator iter)
const_reference operator*() const
A const_reverse_iterator, for base classes that support reverse iteration.
const_pointer operator->() const
const_reference operator()() const
const_reverse_iterator(const_base_iterator iter)
const_pointer get() const
Return the address of the object being referenced.
const_reference operator*() const
An STL-conforming iterator.
reference operator()() const
reference operator*() const
pointer get() const
Return the address of the object being referenced.
iterator(base_iterator iter)
pointer operator->() const
A reverse_iterator, for base classes that support reverse iteration.
reference operator()() const
reference operator*() const
reverse_iterator(base_iterator iter)
pointer get() const
Return the address of the object being referenced.
pointer operator->() const
Template class for non-intrusive linked PtrLists.
typename LListBase::iterator base_iterator
void pop_front(label n=1)
Remove first element(s) from the list (deletes pointers).
LPtrList(LPtrList &&lst)
Move construct.
T & emplace_front(Args &&... args)
Emplace construct new element at front of list. Return reference.
const iterator & end()
End of list for forward iterators.
T & first()
The first entry in the list.
friend Ostream & operator(Ostream &os, const LPtrList< LListBase, T > &list)
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
const T & front() const
The first entry in the list (const access).
const_iterator cbegin() const
Iterator to first item in list with const access.
T & emplace_back(Args &&... args)
Emplace construct new element at back of list. Return reference.
T & back()
The last entry in the list.
LPtrList(Istream &is)
Construct from Istream using default Istream constructor class.
void operator=(LPtrList< LListBase, T > &&lst)
Move assign.
const const_iterator & cend() const
End of list for forward iterators.
const T * const_pointer
Const pointer for LPtrList::value_type objects.
LPtrList(const LPtrList &lst)
Copy construct by using 'clone()' for each element.
LPtrList(Istream &is, const INew &inew)
Construct from Istream using given Istream constructor class.
void operator=(const LPtrList< LListBase, T > &lst)
Copy assign by using 'clone()' for each element.
T * pointer
Pointer for LPtrList::value_type objects.
const T & last() const
The last entry in the list (const access).
const_reverse_iterator crbegin() const
Iterator to last item in list with const access.
const T & back() const
The last entry in the list (const access).
const reverse_iterator & rend()
End of list for reverse iterators.
T & reference
Reference for LPtrList::value_type objects.
const T & first() const
The first entry in the list (const access).
T & front()
The first entry in the list.
LPtrList(T *item)
Construct and add initial item pointer.
const const_reverse_iterator & crend() const
End of list for reverse iterators.
LList< LListBase, T * > parent_type
The parent list storage.
void transfer(LPtrList< LListBase, T > &lst)
Transfer the contents of the argument into this List and annul the argument list.
void clear()
Clear the contents of the 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.
iterator begin()
Iterator to first item in list with non-const access.
LPtrList()=default
Default construct.
~LPtrList()
Destructor. Calls clear().
T & last()
The last entry in the list.
const_reverse_iterator rbegin() const
Iterator to last item in list with const access.
const T & const_reference
Const reference for LPtrList::value_type objects.
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)
Foam::argList args(argc, argv)