LPtrList< LListBase, T > Class Template Reference

Template class for non-intrusive linked PtrLists. More...

Inheritance diagram for LPtrList< LListBase, T >:
Collaboration diagram for LPtrList< LListBase, T >:

Classes

class  const_iterator
 An STL-conforming const_iterator. More...
 
class  iterator
 An STL-conforming iterator. More...
 

Public Types

typedef Treference
 Type that can be used for storing into LPtrList::value_type. More...
 
typedef Tconst_reference
 Type that can be used for storing into constant. More...
 
typedef LListBase::iterator LListBase_iterator
 
typedef LListBase::const_iterator LListBase_const_iterator
 
- Public Types inherited from LList< LListBase, T *>
typedef Tvalue_type
 Type of values the LList contains. More...
 
typedef T * & reference
 Type that can be used for storing into value_type. More...
 
typedef const T * & const_reference
 Type that can be used for storing into constant. More...
 
typedef label size_type
 The type that can represent the size of a LList. More...
 
typedef LListBase::iterator LListBase_iterator
 
typedef LListBase::const_iterator LListBase_const_iterator
 

Public Member Functions

 LPtrList ()
 Null construct. More...
 
 LPtrList (T *a)
 Construct given initial T. More...
 
template<class INew >
 LPtrList (Istream &, const INew &)
 Construct from Istream using given Istream constructor class. More...
 
 LPtrList (Istream &)
 Construct from Istream using default Istream constructor class. More...
 
 LPtrList (const LPtrList &)
 Copy constructor. More...
 
 LPtrList (LPtrList &&)
 Move constructor. More...
 
 ~LPtrList ()
 Destructor. More...
 
Tfirst ()
 Return the first entry added. More...
 
const Tfirst () const
 Return const access to the first entry added. More...
 
Tlast ()
 Return the last entry added. More...
 
const Tlast () const
 Return const access to the last entry added. More...
 
bool eraseHead ()
 Remove the head element from the list and delete the pointer. More...
 
void clear ()
 Clear the contents of the list. More...
 
void transfer (LPtrList< LListBase, T > &)
 Transfer the contents of the argument into this List. More...
 
void operator= (const LPtrList< LListBase, T > &)
 Assignment operator. More...
 
void operator= (LPtrList< LListBase, T > &&)
 Move assignment operator. More...
 
- Public Member Functions inherited from LList< LListBase, T *>
 LList ()
 Null construct. More...
 
 LList (T * a)
 Construct given initial T. More...
 
 LList (Istream &)
 Construct from Istream. More...
 
 LList (const LList< LListBase, T * > &)
 Copy constructor. More...
 
 LList (LList< LListBase, T * > &&)
 Move constructor. More...
 
 LList (std::initializer_list< T * >)
 Construct from an initialiser list. More...
 
 ~LList ()
 Destructor. More...
 
T * & first ()
 Return the first entry added. More...
 
const T * & first () const
 Return const access to the first entry added. More...
 
T * & last ()
 Return the last entry added. More...
 
const T * & last () const
 Return const access to the last entry added. More...
 
void insert (const T * &a)
 Add at head of list. More...
 
void append (const T * &a)
 Add at tail of list. More...
 
TremoveHead ()
 Remove and return head. More...
 
Tremove (link *l)
 Remove and return element. More...
 
Tremove (iterator &it)
 Remove and return element specified by iterator. More...
 
void clear ()
 Delete contents of list. More...
 
void transfer (LList< LListBase, T * > &)
 Transfer the contents of the argument into this List. More...
 
void operator= (const LList< LListBase, T * > &)
 Assignment operator. More...
 
void operator= (LList< LListBase, T * > &&)
 Move assignment operator. More...
 
void operator= (std::initializer_list< T * >)
 Assignment to an initialiser list. More...
 
iterator begin ()
 
const_iterator begin () const
 
const iteratorend ()
 
const const_iteratorend () const
 
const_iterator cbegin () const
 
const const_iteratorcend () const
 

Friends

class iterator
 
class const_iterator
 
Istreamoperator>> (Istream &, LPtrList< LListBase, T > &)
 
Ostreamoperator (Ostream &, const LPtrList< LListBase, T > &)
 

Detailed Description

template<class LListBase, class T>
class Foam::LPtrList< LListBase, T >

Template class for non-intrusive linked PtrLists.

Source files

Definition at line 47 of file LPtrList.H.

Member Typedef Documentation

◆ reference

typedef T& reference

Type that can be used for storing into LPtrList::value_type.

objects.

Definition at line 176 of file LPtrList.H.

◆ const_reference

typedef T& const_reference

Type that can be used for storing into constant.

LPtrList::value_type objects.

Definition at line 180 of file LPtrList.H.

◆ LListBase_iterator

typedef LListBase::iterator LListBase_iterator

Definition at line 185 of file LPtrList.H.

◆ LListBase_const_iterator

typedef LListBase::const_iterator LListBase_const_iterator

Definition at line 218 of file LPtrList.H.

Constructor & Destructor Documentation

◆ LPtrList() [1/6]

LPtrList ( )
inline

Null construct.

Definition at line 94 of file LPtrList.H.

Referenced by LPtrList< LListBase, T >::LPtrList().

Here is the caller graph for this function:

◆ LPtrList() [2/6]

LPtrList ( T a)
inline

Construct given initial T.

Definition at line 98 of file LPtrList.H.

References LPtrList< LListBase, T >::LPtrList(), and LPtrList< LListBase, T >::~LPtrList().

Here is the call graph for this function:

◆ LPtrList() [3/6]

LPtrList ( Istream is,
const INew iNew 
)

Construct from Istream using given Istream constructor class.

Definition at line 143 of file LPtrListIO.C.

References Foam::blockMeshTools::read().

Here is the call graph for this function:

◆ LPtrList() [4/6]

LPtrList ( Istream is)

Construct from Istream using default Istream constructor class.

Definition at line 150 of file LPtrListIO.C.

References LPtrList< LListBase, T >::clear(), Foam::nl, Foam::operator>>(), and Foam::blockMeshTools::read().

Here is the call graph for this function:

◆ LPtrList() [5/6]

LPtrList ( const LPtrList< LListBase, T > &  )

Copy constructor.

◆ LPtrList() [6/6]

LPtrList ( LPtrList< LListBase, T > &&  )

Move constructor.

◆ ~LPtrList()

~LPtrList ( )

Destructor.

Definition at line 50 of file LPtrList.C.

References clear().

Referenced by LPtrList< LListBase, T >::LPtrList().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ first() [1/2]

T& first ( )
inline

Return the first entry added.

Definition at line 126 of file LPtrList.H.

References LList< LListBase, T >::first().

Here is the call graph for this function:

◆ first() [2/2]

const T& first ( ) const
inline

Return const access to the first entry added.

Definition at line 132 of file LPtrList.H.

References LList< LListBase, T >::first().

Here is the call graph for this function:

◆ last() [1/2]

T& last ( )
inline

Return the last entry added.

Definition at line 138 of file LPtrList.H.

References LList< LListBase, T >::last().

Here is the call graph for this function:

◆ last() [2/2]

const T& last ( ) const
inline

Return const access to the last entry added.

Definition at line 144 of file LPtrList.H.

References LPtrList< LListBase, T >::clear(), LPtrList< LListBase, T >::eraseHead(), LList< LListBase, T >::last(), LPtrList< LListBase, T >::operator=(), Foam::T(), and LPtrList< LListBase, T >::transfer().

Here is the call graph for this function:

◆ eraseHead()

bool eraseHead ( )

Remove the head element from the list and delete the pointer.

Definition at line 59 of file LPtrList.C.

References T.

Referenced by LPtrList< LListBase, T >::last().

Here is the caller graph for this function:

◆ clear()

void clear ( )

Clear the contents of the list.

Definition at line 75 of file LPtrList.C.

References clear().

Referenced by LPtrList< LListBase, T >::last(), and LPtrList< LListBase, T >::LPtrList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ transfer()

void transfer ( LPtrList< LListBase, T > &  lst)

Transfer the contents of the argument into this List.

and annul the argument list.

Definition at line 88 of file LPtrList.C.

References clear().

Referenced by LPtrList< LListBase, T >::last().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [1/2]

void operator= ( const LPtrList< LListBase, T > &  lst)

Assignment operator.

Definition at line 98 of file LPtrList.C.

References LList< LListBase, T *>::begin(), clear(), Foam::clone(), and LList< LListBase, T *>::end().

Referenced by LPtrList< LListBase, T >::last().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=() [2/2]

void operator= ( LPtrList< LListBase, T > &&  lst)

Move assignment operator.

Definition at line 110 of file LPtrList.C.

Friends And Related Function Documentation

◆ iterator

friend class iterator
friend

Definition at line 84 of file LPtrList.H.

◆ const_iterator

friend class const_iterator
friend

Definition at line 87 of file LPtrList.H.

◆ operator>>

Istream& operator>> ( Istream ,
LPtrList< LListBase, T > &   
)
friend

◆ operator

Ostream& operator ( Ostream ,
const LPtrList< LListBase, T > &   
)
friend

The documentation for this class was generated from the following files: