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... | |
T * | ptr () |
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... | |
T & | operator() () |
Return reference to the object data. More... | |
const T & | operator() () const |
Return const reference to the object data. More... | |
operator const T & () const | |
Const cast to the underlying type reference. More... | |
T * | operator-> () |
Return object pointer. More... | |
const T * | operator-> () const |
Return const object pointer. More... | |
void | operator= (const autoPtr< T > &) |
Take over the object pointer from parameter. More... | |
Private Attributes | |
T * | ptr_ |
Pointer to object. More... | |
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.
Construct as copy by transferring pointer to this autoPtr and.
setting the arguments pointer to NULL
Construct either by transferring pointer or cloning. Should.
only be called with type that supports cloning.
|
inline |
Destructor, delete object if pointer is not NULL.
Definition at line 67 of file autoPtrI.H.
|
inline |
Return true if the autoPtr is empty (ie, no pointer set).
Definition at line 76 of file autoPtrI.H.
Referenced by sampledSurfaces::sampleAndWrite().
|
inline |
Return true if the autoPtr valid (ie, the pointer is set).
Definition at line 83 of file autoPtrI.H.
Referenced by refinementHistoryConstraint::add(), autoLayerDriver::addLayers(), AMIInterpolation< SourcePatch, TargetPatch >::agglomerate(), refinementHistoryConstraint::apply(), medialAxisMeshMover::calculateDisplacement(), AMIInterpolation< SourcePatch, TargetPatch >::constructFromSurface(), createReconstructMap(), autoSnapDriver::detectNearSurfaces(), autoSnapDriver::determineBaffleFeatures(), autoSnapDriver::determineFeatures(), doCommand(), autoSnapDriver::doSnap(), autoSnapDriver::featureAttractionUsingReconstruction(), refinementHistory::freeSplitCell(), meshRefinement::getIntersections(), autoLayerDriver::handleFeatureAngle(), main(), autoSnapDriver::preventFaceSqueeze(), procFacesGAMGProcAgglomeration::processorAgglomeration(), radiativeIntensityRay::radiativeIntensityRay(), readFields(), reconstructLagrangian(), redistributeLagrangian(), autoSnapDriver::releasePointsNextToMultiPatch(), cyclicPeriodicAMIPolyPatch::resetAMI(), rawTopoChangerFvMesh::update(), mixerFvMesh::update(), movingConeTopoFvMesh::update(), and externalCoupledFunctionObject::writeGeometry().
|
inline |
Return object pointer for reuse.
Definition at line 90 of file autoPtrI.H.
Referenced by PtrListDictionary< phaseModel >::set(), triSurfaceMesh::setField(), and regIOobject::store().
|
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().
|
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().
|
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().
|
inline |
Return reference to the object data.
Definition at line 135 of file autoPtrI.H.
|
inline |
Return const reference to the object data.
Definition at line 150 of file autoPtrI.H.
|
inline |
Const cast to the underlying type reference.
Definition at line 165 of file autoPtrI.H.
|
inline |
Return object pointer.
Definition at line 172 of file autoPtrI.H.
|
inline |
Return const object pointer.
Definition at line 187 of file autoPtrI.H.
Take over the object pointer from parameter.
Definition at line 194 of file autoPtrI.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.