Public Member Functions | Private Attributes
autoPtr Class Reference

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...

Public Member Functions

 autoPtr (T *=0)
 Store object pointer. More...
 
 autoPtr (const autoPtr< T > &)
 Construct as copy by transferring pointer to this autoPtr and. More...
 
 autoPtr (const autoPtr< T > &, const bool reUse)
 Construct either by transferring pointer or cloning. Should. More...
 
 ~autoPtr ()
 Destructor, delete object if pointer is not NULL. More...
 
bool empty () const
 Return true if the autoPtr is empty (ie, no pointer set). More...
 
bool valid () const
 Return true if the autoPtr valid (ie, the pointer is set). More...
 
Tptr ()
 Return object pointer for reuse. More...
 
void set (T *)
 Set pointer to that given. More...
 
void reset (T *=0)
 If object pointer already set, delete object and set to given. More...
 
void clear ()
 Delete object (if the pointer is valid) and set pointer to NULL. More...
 
Toperator() ()
 Return reference to the object data. More...
 
const Toperator() () const
 Return const reference to the object data. 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 autoPtr< T > &)
 Take over the object pointer from parameter. More...
 

Private Attributes

Tptr_
 Pointer to object. More...
 

Detailed Description

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.

Source files

Definition at line 117 of file PtrList.H.

Constructor & Destructor Documentation

◆ autoPtr() [1/3]

autoPtr ( T = 0)
inlineexplicit

Store object pointer.

◆ autoPtr() [2/3]

autoPtr ( const autoPtr< T > &  )
inline

Construct as copy by transferring pointer to this autoPtr and.

setting the arguments pointer to NULL

◆ autoPtr() [3/3]

autoPtr ( const autoPtr< T > &  ,
const bool  reUse 
)
inline

Construct either by transferring pointer or cloning. Should.

only be called with type that supports cloning.

◆ ~autoPtr()

~autoPtr ( )
inline

Destructor, delete object if pointer is not NULL.

Definition at line 67 of file autoPtrI.H.

Member Function Documentation

◆ empty()

bool empty ( ) const
inline

Return true if the autoPtr is empty (ie, no pointer set).

Definition at line 76 of file autoPtrI.H.

Referenced by sampledSurfaces::sampleAndWrite().

Here is the caller graph for this function:

◆ valid()

bool valid ( ) const
inline

◆ ptr()

T * ptr ( )
inline

Return object pointer for reuse.

Definition at line 90 of file autoPtrI.H.

Referenced by PtrListDictionary< phaseModel >::set(), triSurfaceMesh::setField(), and regIOobject::store().

Here is the caller graph for this function:

◆ set()

void set ( T p)
inline

Set pointer to that given.

If object pointer already set issue a FatalError.

Definition at line 99 of file autoPtrI.H.

Referenced by functionObjectFile::createFile(), createRefinementSurfaces(), searchablePlateFeatures::features(), and main().

Here is the caller graph for this function:

◆ reset()

void reset ( T p = 0)
inline

If object pointer already set, delete object and set to given.

pointer

Definition at line 114 of file autoPtrI.H.

Referenced by refinementHistoryConstraint::add(), polyMeshAdder::add(), AMIInterpolation< SourcePatch, TargetPatch >::agglomerate(), refinementHistoryConstraint::apply(), InteractionLists< typename CloudType::parcelType >::buildMap(), canopySource::calculateCanopy(), medialAxisMeshMover::calculateDisplacement(), vtkPV4Foam::convertVolField(), vtkPV3Foam::convertVolFields(), createReconstructMap(), autoSnapDriver::detectNearSurfaces(), autoSnapDriver::determineBaffleFeatures(), autoSnapDriver::determineFeatures(), distributedTriSurfaceMesh::distribute(), autoSnapDriver::doSnap(), autoSnapDriver::featureAttractionUsingReconstruction(), meshRefinement::getIntersections(), autoLayerDriver::handleFeatureAngle(), main(), polyTopoChange::makeMesh(), searchableSurfacesQueries::morphTet(), autoSnapDriver::preventFaceSqueeze(), GAMGSolver::procAgglomerateMatrix(), radiativeIntensityRay::radiativeIntensityRay(), externalCoupledFunctionObject::readData(), triSurface::readSTLBINARY(), reconstructLagrangian(), redistributeAndWrite(), redistributeLagrangian(), multiDirRefinement::refineFromDict(), autoSnapDriver::releasePointsNextToMultiPatch(), cyclicPeriodicAMIPolyPatch::resetAMI(), procFacesGAMGProcAgglomeration::singleCellMesh(), sampledThresholdCellFaces::updateGeometry(), sampledIsoSurfaceCell::updateGeometry(), externalCoupledFunctionObject::writeData(), domainDecomposition::writeDecomposition(), and externalCoupledFunctionObject::writeGeometry().

Here is the caller graph for this function:

◆ clear()

void clear ( )
inline

Delete object (if the pointer is valid) and set pointer to NULL.

Definition at line 126 of file autoPtrI.H.

Referenced by meshRefinement::distribute(), autoSnapDriver::doSnap(), main(), readProcAddressing(), and cyclicPeriodicAMIPolyPatch::resetAMI().

Here is the caller graph for this function:

◆ operator()() [1/2]

T & operator() ( )
inline

Return reference to the object data.

Definition at line 135 of file autoPtrI.H.

◆ operator()() [2/2]

const T & operator() ( ) const
inline

Return const reference to the object data.

Definition at line 150 of file autoPtrI.H.

◆ operator const T &()

operator const T & ( ) const
inline

Const cast to the underlying type reference.

Definition at line 165 of file autoPtrI.H.

◆ operator->() [1/2]

T * operator-> ( )
inline

Return object pointer.

Definition at line 172 of file autoPtrI.H.

◆ operator->() [2/2]

const T * operator-> ( ) const
inline

Return const object pointer.

Definition at line 187 of file autoPtrI.H.

◆ operator=()

void operator= ( const autoPtr< T > &  ap)
inline

Take over the object pointer from parameter.

Definition at line 194 of file autoPtrI.H.

Field Documentation

◆ ptr_

T* ptr_
mutableprivate

Pointer to object.

Definition at line 55 of file autoPtr.H.


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