Public Member Functions | Private Attributes
tmp Class Reference

A class for managing temporary objects. More...

Inheritance diagram for tmp:
Inheritance graph
[legend]

Public Member Functions

 tmp (T *=0)
 Store object pointer. More...
 
 tmp (const T &)
 Store object const reference. More...
 
 tmp (const tmp< T > &)
 Construct copy and increment reference count. More...
 
 tmp (const tmp< T > &, bool allowTransfer)
 Construct copy transferring content of temporary if required. More...
 
 ~tmp ()
 Destructor, delete object when reference count == 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...
 
Tptr () const
 Return tmp pointer for reuse. More...
 
void clear () const
 If object pointer points to valid object: More...
 
Toperator() ()
 Dereference operator. 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= (const tmp< T > &)
 Assignment operator. More...
 

Private Attributes

bool isTmp_
 Flag for whether object is a temporary or a constant object. More...
 
Tptr_
 Pointer to temporary object. More...
 
const Tref_
 Const reference to constant object. More...
 

Detailed Description

A class for managing temporary objects.

Source files

Definition at line 118 of file PtrList.H.

Constructor & Destructor Documentation

◆ tmp() [1/4]

tmp ( T = 0)
inlineexplicit

Store object pointer.

◆ tmp() [2/4]

tmp ( const T )
inline

Store object const reference.

◆ tmp() [3/4]

tmp ( const tmp< T > &  )
inline

Construct copy and increment reference count.

◆ tmp() [4/4]

tmp ( const tmp< T > &  ,
bool  allowTransfer 
)
inline

Construct copy transferring content of temporary if required.

◆ ~tmp()

~tmp ( )
inline

Destructor, delete object when reference count == 0.

Definition at line 105 of file tmpI.H.

Member Function Documentation

◆ isTmp()

bool isTmp ( ) const
inline

Return true if this is really a temporary object.

Definition at line 125 of file tmpI.H.

Referenced by DispersionRASModel< CloudType >::cacheFields(), and BrownianMotionForce< CloudType >::cacheFields().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inline

Return true if this temporary object empty,.

ie, a temporary without allocation

Definition at line 132 of file tmpI.H.

◆ valid()

bool valid ( ) const
inline

Is this temporary object valid,.

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

Definition at line 139 of file tmpI.H.

◆ ptr()

T * ptr ( ) const
inline

◆ clear()

void clear ( ) const
inline

◆ operator()() [1/2]

T & operator() ( )
inline

Dereference operator.

Definition at line 185 of file tmpI.H.

◆ operator()() [2/2]

const T & operator() ( ) const
inline

Const dereference operator.

Definition at line 214 of file tmpI.H.

◆ operator const T &()

operator const T & ( ) const
inline

Const cast to the underlying type reference.

Definition at line 235 of file tmpI.H.

◆ operator->() [1/2]

T * operator-> ( )
inline

Return object pointer.

Definition at line 242 of file tmpI.H.

◆ operator->() [2/2]

const T * operator-> ( ) const
inline

Return const object pointer.

Definition at line 263 of file tmpI.H.

◆ operator=()

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

Assignment operator.

Definition at line 270 of file tmpI.H.

Field Documentation

◆ isTmp_

bool isTmp_
private

Flag for whether object is a temporary or a constant object.

Definition at line 55 of file tmp.H.

Referenced by tmp< Foam::surfaceInterpolationScheme< GType > >::operator=().

◆ ptr_

T* ptr_
mutableprivate

Pointer to temporary object.

Definition at line 58 of file tmp.H.

Referenced by tmp< Foam::surfaceInterpolationScheme< GType > >::operator=().

◆ ref_

const T& ref_
private

Const reference to constant object.

Definition at line 61 of file tmp.H.


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