Public Types | Public Member Functions | Static Public Member Functions | List of all members
refPtr Class Reference

A class for managing references or pointers (no reference counting) More...

Inheritance diagram for refPtr:
Inheritance graph
[legend]

Public Types

typedef T element_type
 
typedef Tpointer
 
typedef Foam::refCount::zero refCount
 

Public Member Functions

constexpr refPtr () noexcept
 
constexpr refPtr (std::nullptr_t) noexcept
 
constexpr refPtr (T *p) noexcept
 
 refPtr (autoPtr< T > &&ptr) noexcept
 
 refPtr (std::unique_ptr< T > &&ptr) noexcept
 
constexpr refPtr (const T &obj) noexcept
 
 refPtr (refPtr< T > &&rhs) noexcept
 
 refPtr (const refPtr< T > &rhs)
 
 refPtr (const refPtr< T > &rhs, bool reuse)
 
 ~refPtr ()
 
bool good () const noexcept
 
bool is_const () const noexcept
 
bool is_pointer () const noexcept
 
bool movable () const noexcept
 
Tget () noexcept
 
const Tget () const noexcept
 
const Tcref () const
 
Tref () const
 
TconstCast () const
 
refPtr< TshallowClone () const noexcept
 
Trelease () noexcept
 
Tptr () const
 
void clear () const noexcept
 
void reset (refPtr< T > &&other) noexcept
 
void reset (T *p=nullptr) noexcept
 
void reset (autoPtr< T > &&other) noexcept
 
void reset (std::unique_ptr< T > &&other)
 
void cref (const refPtr< T > &other) noexcept
 
void cref (const T &obj) noexcept
 
void cref (const T *p) noexcept
 
void ref (T &obj) noexcept
 
void ref (T *p) noexcept
 
void swap (refPtr< T > &other) noexcept
 
const Toperator* () const
 
Toperator* ()
 
const Toperator-> () const
 
Toperator-> ()
 
const Toperator() () const
 
 operator bool () const noexcept
 
 operator const T & () const
 
void operator= (const refPtr< T > &other)
 
void operator= (refPtr< T > &&other) noexcept
 
void operator= (T *p)
 
void operator= (std::nullptr_t) noexcept
 
 operator tmp< T > ()
 
bool valid () const noexcept
 
bool empty () const noexcept
 
template<class... Args>
Foam::refPtr< TNew (Args &&... args)
 
template<class U , class... Args>
Foam::refPtr< TNewFrom (Args &&... args)
 

Static Public Member Functions

template<class... Args>
static refPtr< TNew (Args &&... args)
 
template<class U , class... Args>
static refPtr< TNewFrom (Args &&... args)
 
static word typeName ()
 

Detailed Description

A class for managing references or pointers (no reference counting)

Source files
See also
Foam::autoPtr Foam::tmp

Definition at line 56 of file PtrList.H.

Member Typedef Documentation

◆ element_type

typedef T element_type

Definition at line 77 of file refPtr.H.

◆ pointer

typedef T* pointer

Definition at line 80 of file refPtr.H.

◆ refCount

Definition at line 84 of file refPtr.H.

Constructor & Destructor Documentation

◆ refPtr() [1/9]

constexpr refPtr ( )
inlineconstexprnoexcept

◆ refPtr() [2/9]

constexpr refPtr ( std::nullptr_t  )
inlineconstexprnoexcept

◆ refPtr() [3/9]

constexpr refPtr ( T p)
inlineexplicitconstexprnoexcept

◆ refPtr() [4/9]

refPtr ( autoPtr< T > &&  ptr)
inlineexplicitnoexcept

◆ refPtr() [5/9]

refPtr ( std::unique_ptr< T > &&  ptr)
inlineexplicitnoexcept

◆ refPtr() [6/9]

constexpr refPtr ( const T obj)
inlineconstexprnoexcept

◆ refPtr() [7/9]

refPtr ( refPtr< T > &&  rhs)
inlinenoexcept

◆ refPtr() [8/9]

refPtr ( const refPtr< T > &  rhs)
inline

Definition at line 110 of file refPtrI.H.

◆ refPtr() [9/9]

refPtr ( const refPtr< T > &  rhs,
bool  reuse 
)
inline

Definition at line 133 of file refPtrI.H.

◆ ~refPtr()

~refPtr ( )
inline

Definition at line 166 of file refPtrI.H.

Member Function Documentation

◆ New() [1/2]

static refPtr<T> New ( Args &&...  args)
inlinestatic

◆ NewFrom() [1/2]

static refPtr<T> NewFrom ( Args &&...  args)
inlinestatic

◆ typeName()

Foam::word typeName ( )
inlinestatic

Definition at line 44 of file refPtrI.H.

◆ good()

bool good ( ) const
inlinenoexcept

Definition at line 150 of file refPtr.H.

Referenced by PrecisionAdaptor< Type, InputType, Container >::commit().

Here is the caller graph for this function:

◆ is_const()

bool is_const ( ) const
inlinenoexcept

Definition at line 153 of file refPtr.H.

◆ is_pointer()

bool is_pointer ( ) const
inlinenoexcept

Definition at line 156 of file refPtr.H.

Referenced by regIOobject::store().

Here is the caller graph for this function:

◆ movable()

bool movable ( ) const
inlinenoexcept

Definition at line 175 of file refPtrI.H.

◆ get() [1/2]

T* get ( )
inlinenoexcept

Definition at line 165 of file refPtr.H.

Referenced by PrecisionAdaptor< Type, InputType, Container >::set(), and regIOobject::store().

Here is the caller graph for this function:

◆ get() [2/2]

const T* get ( ) const
inlinenoexcept

Definition at line 168 of file refPtr.H.

◆ cref() [1/4]

const T & cref ( ) const
inline

◆ ref() [1/3]

T & ref ( ) const
inline

◆ constCast()

T & constCast ( ) const
inline

Definition at line 217 of file refPtrI.H.

◆ shallowClone()

Foam::refPtr< T > shallowClone ( ) const
inlinenoexcept

Definition at line 224 of file refPtrI.H.

◆ release()

T * release ( )
inlinenoexcept

Definition at line 239 of file refPtrI.H.

Referenced by regIOobject::store().

Here is the caller graph for this function:

◆ ptr()

T * ptr ( ) const
inline

◆ clear()

void clear ( ) const
inlinenoexcept

Definition at line 276 of file refPtrI.H.

◆ reset() [1/4]

void reset ( refPtr< T > &&  other)
inlinenoexcept

Referenced by fvExprDriver::getTopoSetLabels().

Here is the caller graph for this function:

◆ reset() [2/4]

void reset ( T p = nullptr)
inlinenoexcept

◆ reset() [3/4]

void reset ( autoPtr< T > &&  other)
inlinenoexcept

Definition at line 213 of file refPtr.H.

Referenced by refPtr< Foam::OSstream >::reset().

Here is the caller graph for this function:

◆ reset() [4/4]

void reset ( std::unique_ptr< T > &&  other)
inline

Definition at line 216 of file refPtr.H.

Referenced by refPtr< Foam::OSstream >::reset().

Here is the caller graph for this function:

◆ cref() [2/4]

void cref ( const refPtr< T > &  other)
inlinenoexcept

◆ cref() [3/4]

void cref ( const T obj)
inlinenoexcept

◆ cref() [4/4]

void cref ( const T p)
inlinenoexcept

◆ ref() [2/3]

void ref ( T obj)
inlinenoexcept

◆ ref() [3/3]

void ref ( T p)
inlinenoexcept

◆ swap()

void swap ( refPtr< T > &  other)
inlinenoexcept

Definition at line 363 of file refPtrI.H.

◆ operator*() [1/2]

const T & operator* ( ) const
inline

Definition at line 380 of file refPtrI.H.

◆ operator*() [2/2]

T & operator* ( )
inline

Definition at line 393 of file refPtrI.H.

◆ operator->() [1/2]

const T * operator-> ( ) const
inline

Definition at line 414 of file refPtrI.H.

◆ operator->() [2/2]

T * operator-> ( )
inline

Definition at line 428 of file refPtrI.H.

◆ operator()()

const T& operator() ( ) const
inline

Definition at line 261 of file refPtr.H.

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Definition at line 267 of file refPtr.H.

◆ operator const T &()

operator const T & ( ) const
inline

Definition at line 270 of file refPtr.H.

◆ operator=() [1/4]

void operator= ( const refPtr< T > &  other)
inline

Definition at line 449 of file refPtrI.H.

◆ operator=() [2/4]

void operator= ( refPtr< T > &&  other)
inlinenoexcept

◆ operator=() [3/4]

void operator= ( T p)
inline

Definition at line 500 of file refPtrI.H.

◆ operator=() [4/4]

void operator= ( std::nullptr_t  )
inlinenoexcept

◆ operator tmp< T >()

operator tmp< T > ( )
inline

Definition at line 522 of file refPtrI.H.

◆ valid()

bool valid ( ) const
inlinenoexcept

Definition at line 296 of file refPtr.H.

Referenced by parseDriver::getField(), fvExprDriver::getTopoSetLabels(), fvExprDriver::getVariable(), and parseDriver::getVariableIfAvailable().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 302 of file refPtr.H.

◆ New() [2/2]

Foam::refPtr<T> New ( Args &&...  args)
inline

Definition at line 29 of file refPtrI.H.

◆ NewFrom() [2/2]

Foam::refPtr<T> NewFrom ( Args &&...  args)
inline

Definition at line 37 of file refPtrI.H.


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