Classes | Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
UPtrList Class Reference

A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers - this is to be done elsewhere. The operator[] returns a reference to the object, not the pointer. More...

Inheritance diagram for UPtrList:
Inheritance graph
[legend]

Classes

class  const_iterator
 
class  iterator
 

Public Types

typedef T value_type
 
typedef Treference
 

Public Member Functions

constexpr UPtrList () noexcept
 
 UPtrList (const label len)
 
 UPtrList (const UPtrList< T > &list)
 
 UPtrList (UPtrList< T > &&list)
 
 UPtrList (UPtrList< T > &list, bool reuse)
 
 UPtrList (PtrList< T > &list)
 
 UPtrList (const UList< T * > &list)
 
 UPtrList (UList< T > &list)
 
label size () const noexcept
 
bool empty () const noexcept
 
Tfirst ()
 
const Tfirst () const
 
Tlast ()
 
const Tlast () const
 
Tget (const label i)
 
const Tget (const label i) const
 
const Tset (const label i) const
 
void clear ()
 
void resize (const label newLen)
 
void setSize (const label n)
 
label squeezeNull ()
 
void append (T *ptr)
 
void swap (UPtrList< T > &list)
 
void transfer (UPtrList< T > &list)
 
Tset (const label i, T *ptr)
 
void reorder (const labelUList &oldToNew, const bool testNull=true)
 
void sortOrder (const labelUList &order, const bool testNull=true)
 
const Toperator[] (const label i) const
 
Toperator[] (const label i)
 
const Toperator() (const label i) const
 
void operator= (const UPtrList< T > &list)
 
void operator= (UPtrList< T > &&list)
 
iterator begin () noexcept
 
iterator end () noexcept
 
const_iterator cbegin () const noexcept
 
const_iterator cend () const noexcept
 
const_iterator begin () const noexcept
 
const_iterator end () const noexcept
 

Public Attributes

const typedef Tconst_reference
 

Protected Member Functions

void setAddressableSize (const label n) noexcept
 
 UPtrList (Detail::PtrListDetail< T > &&ptrs)
 

Protected Attributes

Detail::PtrListDetail< Tptrs_
 

Friends

Ostreamoperator (Ostream &os, const UPtrList< T > &list)
 

Detailed Description

A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers - this is to be done elsewhere. The operator[] returns a reference to the object, not the pointer.

Note
The class definition is such that it contains a list of pointers, but itself does not inherit from a list of pointers since this would wreak havoc later with inheritance resolution.
See also
Foam::PtrList Foam::PtrDynList
Source files

Definition at line 58 of file UPtrList.H.

Member Typedef Documentation

◆ value_type

typedef T value_type

Definition at line 93 of file UPtrList.H.

◆ reference

typedef T& reference

Definition at line 96 of file UPtrList.H.

Constructor & Destructor Documentation

◆ UPtrList() [1/9]

UPtrList ( Detail::PtrListDetail< T > &&  ptrs)
inlineexplicitprotected

Definition at line 48 of file UPtrListI.H.

◆ UPtrList() [2/9]

constexpr UPtrList ( )
inlineconstexprnoexcept

◆ UPtrList() [3/9]

UPtrList ( const label  len)
inlineexplicit

Definition at line 41 of file UPtrListI.H.

◆ UPtrList() [4/9]

UPtrList ( const UPtrList< T > &  list)
inline

Definition at line 55 of file UPtrListI.H.

◆ UPtrList() [5/9]

UPtrList ( UPtrList< T > &&  list)
inline

Definition at line 62 of file UPtrListI.H.

◆ UPtrList() [6/9]

UPtrList ( UPtrList< T > &  list,
bool  reuse 
)
inline

Definition at line 69 of file UPtrListI.H.

◆ UPtrList() [7/9]

UPtrList ( PtrList< T > &  list)
explicit

Definition at line 29 of file UPtrList.C.

◆ UPtrList() [8/9]

UPtrList ( const UList< T * > &  list)
inlineexplicit

Definition at line 76 of file UPtrListI.H.

◆ UPtrList() [9/9]

UPtrList ( UList< T > &  list)
inlineexplicit

Definition at line 83 of file UPtrListI.H.

Member Function Documentation

◆ setAddressableSize()

void setAddressableSize ( const label  n)
inlineprotectednoexcept

Definition at line 25 of file UPtrListI.H.

◆ size()

Foam::label size ( ) const
inlinenoexcept

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 106 of file UPtrListI.H.

◆ first() [1/2]

T & first ( )
inline

Definition at line 148 of file UPtrListI.H.

◆ first() [2/2]

const T & first ( ) const
inline

Definition at line 155 of file UPtrListI.H.

◆ last() [1/2]

T & last ( )
inline

Definition at line 162 of file UPtrListI.H.

◆ last() [2/2]

const T & last ( ) const
inline

Definition at line 169 of file UPtrListI.H.

◆ get() [1/2]

T * get ( const label  i)
inline

Definition at line 113 of file UPtrListI.H.

Referenced by fvMeshAdder::add(), and UPtrList< const Foam::UList >::set().

Here is the caller graph for this function:

◆ get() [2/2]

const T * get ( const label  i) const
inline

Definition at line 120 of file UPtrListI.H.

◆ set() [1/2]

const T* set ( const label  i) const
inline

◆ clear()

void clear ( )
inline

Definition at line 127 of file UPtrListI.H.

◆ resize()

void resize ( const label  newLen)
inline

Definition at line 176 of file UPtrListI.H.

Referenced by UPtrList< const Foam::UList >::setSize().

Here is the caller graph for this function:

◆ setSize()

void setSize ( const label  n)
inline

Definition at line 185 of file UPtrList.H.

Referenced by fvMatrix< Type >::setInterfaces(), and dynamicOversetFvMesh::updateAddressing().

Here is the caller graph for this function:

◆ squeezeNull()

Foam::label squeezeNull ( )

Definition at line 38 of file UPtrList.C.

◆ append()

void append ( T ptr)
inline

Definition at line 183 of file UPtrListI.H.

◆ swap()

void swap ( UPtrList< T > &  list)
inline

Definition at line 134 of file UPtrListI.H.

◆ transfer()

void transfer ( UPtrList< T > &  list)
inline

Definition at line 141 of file UPtrListI.H.

◆ set() [2/2]

T * set ( const label  i,
T ptr 
)
inline

Definition at line 192 of file UPtrListI.H.

◆ reorder()

void reorder ( const labelUList oldToNew,
const bool  testNull = true 
)

Definition at line 63 of file UPtrList.C.

◆ sortOrder()

void sortOrder ( const labelUList order,
const bool  testNull = true 
)

Definition at line 122 of file UPtrList.C.

Referenced by Foam::shuffle(), and Foam::sort().

Here is the caller graph for this function:

◆ operator[]() [1/2]

const T & operator[] ( const label  i) const
inline

Definition at line 207 of file UPtrListI.H.

◆ operator[]() [2/2]

T & operator[] ( const label  i)
inline

Definition at line 224 of file UPtrListI.H.

◆ operator()()

const T * operator() ( const label  i) const
inline

Definition at line 241 of file UPtrListI.H.

◆ operator=() [1/2]

void operator= ( const UPtrList< T > &  list)
inline

Definition at line 642 of file UPtrListI.H.

◆ operator=() [2/2]

void operator= ( UPtrList< T > &&  list)
inline

Definition at line 649 of file UPtrListI.H.

◆ begin() [1/2]

iterator begin ( )
inlinenoexcept

◆ end() [1/2]

iterator end ( )
inlinenoexcept

◆ cbegin()

Foam::UPtrList< T >::const_iterator cbegin ( ) const
inlinenoexcept

Definition at line 609 of file UPtrListI.H.

◆ cend()

Foam::UPtrList< T >::const_iterator cend ( ) const
inlinenoexcept

Definition at line 617 of file UPtrListI.H.

◆ begin() [2/2]

const_iterator begin ( ) const
inlinenoexcept

◆ end() [2/2]

const_iterator end ( ) const
inlinenoexcept

Friends And Related Function Documentation

◆ operator

Ostream& operator ( Ostream os,
const UPtrList< T > &  list 
)
friend

Member Data Documentation

◆ const_reference

const typedef T& const_reference

Definition at line 99 of file UPtrList.H.

◆ ptrs_

Detail::PtrListDetail<T> ptrs_
protected

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