An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and with pointer allocation checking on access. More...
#include <OpenFOAM/autoPtr.H>
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and with pointer allocation checking on access.
Definition at line 51 of file autoPtr.H.
Public Member Functions | |
autoPtr (T *=0) | |
Store object pointer.
| |
autoPtr (const autoPtr< T > &) | |
Construct as copy by transfering pointer to this autoPtr and.
| |
~autoPtr () | |
Delete object if pointer is not NULL.
| |
bool | empty () const |
Return true if the autoPtr is empty (ie, no pointer set).
| |
bool | valid () const |
Return true if the autoPtr valid (ie, the pointer is set).
| |
T * | ptr () |
Return object pointer for reuse.
| |
void | set (T *) |
Set pointer to that given.
| |
void | reset (T *=0) |
If object pointer already set, delete object and set to given pointer.
| |
void | clear () |
Delete object and set pointer to NULL, if the pointer is valid.
| |
T & | operator() () |
Return reference to the object data.
| |
const T & | operator() () const |
Return const reference to the object data.
| |
operator const T & () const | |
T * | operator-> () |
Return object pointer.
| |
const T * | operator-> () const |
Return const object pointer.
| |
void | operator= (const autoPtr< T > &) |
Take over object pointer from parameter.
|
autoPtr | ( | T * | p = 0
) |
[inline, explicit]
|
Store object pointer.
Definition at line 31 of file autoPtrI.H.
Construct as copy by transfering pointer to this autoPtr and.
setting the arguments pointer to NULL
Definition at line 38 of file autoPtrI.H.
~autoPtr | ( | ) | [inline]
|
bool empty | ( | ) | const [inline]
|
Return true if the autoPtr is empty (ie, no pointer set).
Definition at line 56 of file autoPtrI.H.
Referenced by sampledCuttingPlane::faces(), sampledIsoSurfaceCell::faces(), sampledIsoSurface::faces(), distanceSurface::faces(), directMappedPatchBase::map(), mapDistribute::schedule(), surfaceSlipDisplacementPointPatchVectorField::surfaces(), surfaceDisplacementPointPatchVectorField::surfaces(), and vtkMesh::topo().
bool valid | ( | ) | const [inline]
|
Return true if the autoPtr valid (ie, the pointer is set).
Definition at line 63 of file autoPtrI.H.
Referenced by refinementHistory::compact(), refinementHistory::distribute(), meshRefinement::distribute(), refinementHistory::splitCell8::operator=(), refinementHistory::splitCell8::operator==(), radiativeIntensityRay::radiativeIntensityRay(), rawTopoChangerFvMesh::update(), movingConeTopoFvMesh::update(), and mixerFvMesh::update().
T * ptr | ( | ) | [inline]
|
Return object pointer for reuse.
Definition at line 70 of file autoPtrI.H.
References Foam::T().
Referenced by pairPotential::scaleEnergy(), triSurfaceMesh::setField(), and regIOobject::store().
void set | ( | T * | p ) | [inline]
|
Set pointer to that given.
If object pointer already set issue a FatalError.
Definition at line 79 of file autoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorIn, and p.
void reset | ( | T * | p = 0
) |
[inline]
|
If object pointer already set, delete object and set to given pointer.
Definition at line 93 of file autoPtrI.H.
References p.
Referenced by polyMeshAdder::add(), refinementHistory::combineCells(), distributedTriSurfaceMesh::distribute(), sampledCuttingPlane::faces(), sampledIsoSurfaceCell::faces(), sampledIsoSurface::faces(), distanceSurface::faces(), polyTopoChange::makeMesh(), refinementHistory::splitCell8::operator=(), radiativeIntensityRay::radiativeIntensityRay(), mapDistribute::schedule(), surfaceSlipDisplacementPointPatchVectorField::surfaces(), surfaceDisplacementPointPatchVectorField::surfaces(), vtkMesh::topo(), and triSurfaceSearch::triSurfaceSearch().
void clear | ( | ) | [inline]
|
Delete object and set pointer to NULL, if the pointer is valid.
Definition at line 105 of file autoPtrI.H.
Referenced by meshRefinement::distribute(), and spray::evolve().
T & operator() | ( | ) | [inline]
|
Return reference to the object data.
Definition at line 114 of file autoPtrI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
const T & operator() | ( | ) | const [inline]
|
Return const reference to the object data.
Definition at line 128 of file autoPtrI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
operator const T & | ( | ) | const [inline]
|
Definition at line 158 of file autoPtrI.H.
T * operator-> | ( | ) | [inline]
|
Return object pointer.
Definition at line 165 of file autoPtrI.H.
References Foam::abort(), Foam::FatalError, and FatalErrorIn.
const T * operator-> | ( | ) | const [inline]
|
Return const object pointer.
Definition at line 179 of file autoPtrI.H.
void operator= | ( | const autoPtr< T > & | ap ) | [inline]
|
Take over object pointer from parameter.
Definition at line 186 of file autoPtrI.H.