FreeFOAM The Cross-Platform CFD Toolkit
tmp< T > Class Template Reference

A class for managing temporary objects. More...

#include <OpenFOAM/tmp.H>


Detailed Description

template<class T>
class Foam::tmp< T >

A class for managing temporary objects.

Source files

Definition at line 55 of file tmp.H.

+ Inheritance diagram for tmp< T >:

List of all members.

Public Member Functions

 tmp (T *=0)
 Store object pointer.
 tmp (const T &)
 Store object const reference.
 tmp (const tmp< T > &)
 Construct copy and increment reference count.
 ~tmp ()
 Delete object when reference count == 0.
bool isTmp () const
 Return true if this is really a temporary object.
bool empty () const
 Return true if this temporary object empty,.
bool valid () const
 Is this temporary object valid,.
Tptr () const
 Return tmp pointer for reuse.
void clear () const
 If object pointer points to valid object:
Toperator() ()
 Dereference operator.
const Toperator() () const
 Const dereference operator.
 operator const T & () const
 Const cast to the underlying type reference.
Toperator-> ()
 Return object pointer.
const Toperator-> () const
 Return const object pointer.
void operator= (const tmp< T > &)
 Assignment operator.

Constructor & Destructor Documentation

tmp ( T tPtr = 0)
inlineexplicit

Store object pointer.

Definition at line 31 of file tmpI.H.

tmp ( const T tRef)
inline

Store object const reference.

Definition at line 40 of file tmpI.H.

tmp ( const tmp< T > &  t)
inline

Construct copy and increment reference count.

Definition at line 49 of file tmpI.H.

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

~tmp ( )
inline

Delete object when reference count == 0.

Definition at line 72 of file tmpI.H.


Member Function Documentation

bool isTmp ( ) const
inline

Return true if this is really a temporary object.

Definition at line 92 of file tmpI.H.

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

bool empty ( ) const
inline

Return true if this temporary object empty,.

ie, a temporary without allocation

Definition at line 99 of file tmpI.H.

bool valid ( ) const
inline

Is this temporary object valid,.

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

Definition at line 106 of file tmpI.H.

T & operator() ( )
inline

Dereference operator.

Definition at line 152 of file tmpI.H.

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

const T & operator() ( ) const
inline

Const dereference operator.

Definition at line 181 of file tmpI.H.

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

operator const T & ( ) const
inline

Const cast to the underlying type reference.

Definition at line 202 of file tmpI.H.

T * operator-> ( )
inline

Return object pointer.

Definition at line 209 of file tmpI.H.

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

const T * operator-> ( ) const
inline

Return const object pointer.

Definition at line 230 of file tmpI.H.

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

Assignment operator.

Definition at line 237 of file tmpI.H.

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


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