tmpNrc< T > Class Template Reference

A class for managing temporary objects without reference counting. More...

Inheritance diagram for tmpNrc< T >:

Classes

class  refCount
 

Public Member Functions

 tmpNrc (T *=0)
 Store object pointer. More...
 
 tmpNrc (const T &)
 Store object const reference. More...
 
 tmpNrc (const tmpNrc< T > &)
 Construct copy. More...
 
 tmpNrc (const tmpNrc< T > &&)
 Construct copy moving content. More...
 
 tmpNrc (const tmpNrc< T > &, bool allowTransfer)
 Construct copy transferring content of temporary if required. More...
 
 ~tmpNrc ()
 Destructor: deletes temporary object when the reference count is 0. More...
 
bool isTmp () const
 Return true if this is really a temporary object. More...
 
bool empty () const
 Return true if this temporary object empty,. More...
 
bool valid () const
 Is this temporary object valid,. More...
 
word typeName () const
 Return the type name of the tmpNrc. More...
 
Tref ()
 Return non-const reference or generate a fatal error. More...
 
Tptr () const
 Return tmpNrc pointer for reuse. More...
 
void clear () const
 If object pointer points to valid object: More...
 
const Toperator() () const
 Const dereference operator. More...
 
 operator const T & () const
 Const cast to the underlying type reference. More...
 
Toperator-> ()
 Return object pointer. More...
 
const Toperator-> () const
 Return const object pointer. More...
 
void operator= (T *)
 Assignment to pointer changing this tmpNrc to a temporary T. More...
 
void operator= (const tmpNrc< T > &)
 Assignment transferring the temporary T to this tmpNrc. More...
 
void operator= (const tmpNrc< T > &&)
 Move assignment transferring the temporary T to this tmpNrc. More...
 

Detailed Description

template<class T>
class Foam::tmpNrc< T >

A class for managing temporary objects without reference counting.

Source files
See also
Foam::autoPtr

Definition at line 52 of file tmpNrc.H.

Constructor & Destructor Documentation

◆ tmpNrc() [1/5]

tmpNrc ( T tPtr = 0)
inlineexplicit

Store object pointer.

Definition at line 32 of file tmpNrcI.H.

◆ tmpNrc() [2/5]

tmpNrc ( const T tRef)
inline

Store object const reference.

Definition at line 40 of file tmpNrcI.H.

◆ tmpNrc() [3/5]

tmpNrc ( const tmpNrc< T > &  t)
inline

Construct copy.

Definition at line 48 of file tmpNrcI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmpNrc< T >::isTmp(), and tmpNrc< T >::typeName().

Here is the call graph for this function:

◆ tmpNrc() [4/5]

tmpNrc ( const tmpNrc< T > &&  t)
inline

Construct copy moving content.

Definition at line 70 of file tmpNrcI.H.

References tmpNrc< T >::isTmp().

Here is the call graph for this function:

◆ tmpNrc() [5/5]

tmpNrc ( const tmpNrc< T > &  t,
bool  allowTransfer 
)
inline

Construct copy transferring content of temporary if required.

Definition at line 83 of file tmpNrcI.H.

◆ ~tmpNrc()

~tmpNrc
inline

Destructor: deletes temporary object when the reference count is 0.

Definition at line 112 of file tmpNrcI.H.

Member Function Documentation

◆ isTmp()

bool isTmp
inline

Return true if this is really a temporary object.

Definition at line 121 of file tmpNrcI.H.

Referenced by tmpNrc< T >::operator=(), and tmpNrc< T >::tmpNrc().

Here is the caller graph for this function:

◆ empty()

bool empty
inline

Return true if this temporary object empty,.

ie, a temporary without allocation

Definition at line 128 of file tmpNrcI.H.

◆ valid()

bool valid
inline

Is this temporary object valid,.

ie, it is a reference or a temporary that has been allocated

Definition at line 135 of file tmpNrcI.H.

◆ typeName()

Foam::word typeName
inline

Return the type name of the tmpNrc.

constructed from the type name of T

Definition at line 142 of file tmpNrcI.H.

Referenced by tmpNrc< T >::tmpNrc().

Here is the caller graph for this function:

◆ ref()

T & ref
inline

Return non-const reference or generate a fatal error.

if the object is const.

Definition at line 149 of file tmpNrcI.H.

Referenced by nearest::srcWeights(), nearest::tgtWeights(), and patchToPatch::update().

Here is the caller graph for this function:

◆ ptr()

T * ptr
inline

Return tmpNrc pointer for reuse.

Returns a clone if the object is not a temporary

Definition at line 173 of file tmpNrcI.H.

References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and Foam::T().

Here is the call graph for this function:

◆ clear()

void clear
inline

If object pointer points to valid object:

delete object and set pointer to nullptr

Definition at line 197 of file tmpNrcI.H.

◆ operator()()

const T & operator()
inline

Const dereference operator.

Definition at line 210 of file tmpNrcI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator const T &()

operator const T &
inline

Const cast to the underlying type reference.

Definition at line 228 of file tmpNrcI.H.

◆ operator->() [1/2]

T * operator->
inline

Return object pointer.

Definition at line 235 of file tmpNrcI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator->() [2/2]

const T * operator->
inline

Return const object pointer.

Definition at line 258 of file tmpNrcI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator=() [1/3]

void operator= ( T tPtr)
inline

Assignment to pointer changing this tmpNrc to a temporary T.

Definition at line 272 of file tmpNrcI.H.

References Foam::abort(), clear(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ operator=() [2/3]

void operator= ( const tmpNrc< T > &  t)
inline

Assignment transferring the temporary T to this tmpNrc.

Definition at line 289 of file tmpNrcI.H.

References Foam::abort(), clear(), Foam::FatalError, FatalErrorInFunction, tmpNrc< T >::isTmp(), Foam::name(), and Foam::T().

Here is the call graph for this function:

◆ operator=() [3/3]

void operator= ( const tmpNrc< T > &&  t)
inline

Move assignment transferring the temporary T to this tmpNrc.

Definition at line 318 of file tmpNrcI.H.

References clear().

Here is the call graph for this function:

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