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...
Inherited by LList< Foam::autoPtr< Foam::regExp > >.
Public Types | |
typedef T | Type |
Public Member Functions | |
autoPtr (T *=nullptr) | |
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. More... | |
~autoPtr () | |
Destructor, delete object if pointer is not nullptr. 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 *=nullptr) |
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. More... | |
T & | operator() () |
Return reference to the object data. More... | |
const T & | operator() () const |
Return const reference to the object data. 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= (T *) |
Take over the object pointer from parameter. More... | |
void | operator= (const autoPtr< T > &) |
Take over the object pointer from parameter. 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.
Store object pointer.
Definition at line 32 of file autoPtrI.H.
Construct as copy by transferring pointer to this autoPtr and.
setting the arguments pointer to nullptr
Definition at line 39 of file autoPtrI.H.
Construct either by transferring pointer or cloning.
Should only be called with type that supports cloning
Definition at line 48 of file autoPtrI.H.
|
inline |
Destructor, delete object if pointer is not nullptr.
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.
|
inline |
Return true if the autoPtr valid (ie, the pointer is set)
Definition at line 83 of file autoPtrI.H.
Referenced by refinementHistoryConstraint::add(), refinementHistoryConstraint::apply(), autoPtr< diffusiveMassTransferModel >::autoPtr(), snappySnapDriver::detectNearSurfaces(), meshRefinement::distribute(), snappySnapDriver::doSnap(), cellCuts::edgeWeight(), Foam::fileHandler(), PrimitiveOldTimePatch< Foam::List, Foam::Field >::has0(), polyTopoChangeMap::hasOldCellVolumes(), coupledPolyPatch::initOrder(), repatchMesh::mesh(), listPlusEqOp< T >::operator()(), Foam::operator<<(), coupledPolyPatch::order(), cyclicPolyPatch::order(), AMIInterpolation::patchMagSf(), projectCurveEdge::position(), projectEdge::position(), GAMGAgglomeration::processorAgglomerate(), projectFace::project(), radiativeIntensityRay::radiativeIntensityRay(), functionObjectList::read(), masterUncollatedFileOperation::read(), decomposedBlockData::readBlocks(), uncollatedFileOperation::readHeader(), uncollatedFileOperation::readStream(), masterUncollatedFileOperation::readStream(), polyMesh::readUpdate(), raw::update(), movingCone::update(), histogram::write(), OFstreamCollator::write(), regionSizeDistribution::write(), decomposedBlockData::writeBlocks(), medialAxisMeshMover::~medialAxisMeshMover(), and OFstreamCollator::~OFstreamCollator().
|
inline |
Return object pointer for reuse.
Definition at line 90 of file autoPtrI.H.
Referenced by autoPtr< diffusiveMassTransferModel >::autoPtr(), rigidBodyModel::join(), functionObjectList::read(), masterUncollatedFileOperation::read(), PtrListDictionary< fvModel >::set(), triSurfaceMesh::setField(), regIOobject::store(), and OFstreamCollator::write().
|
inline |
Set pointer to that given.
If object pointer already set issue a FatalError
Definition at line 99 of file autoPtrI.H.
Referenced by searchablePlateFeatures::features(), rigidBodyModel::merge(), and functionObjectList::read().
|
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(), refinementHistoryConstraint::apply(), snappySnapDriver::detectNearSurfaces(), distributedTriSurfaceMesh::distribute(), PatchTools::gatherAndMerge(), polyTopoChange::makeMesh(), functionObjectList::New(), listPlusEqOp< T >::operator()(), AMIInterpolation::patchMagSf(), projectCurveEdge::position(), projectEdge::position(), projectFace::project(), radiativeIntensityRay::radiativeIntensityRay(), decomposedBlockData::read(), masterUncollatedFileOperation::read(), masterUncollatedFileOperation::readStream(), histogram::write(), OFstreamCollator::write(), regionSizeDistribution::write(), decomposedBlockData::writeObject(), and medialAxisMeshMover::~medialAxisMeshMover().
|
inline |
Delete object (if the pointer is valid) and set pointer to.
nullptr
Definition at line 126 of file autoPtrI.H.
Referenced by polyMeshAdder::add(), meshRefinement::distribute(), damping::readCoeffs(), masterUncollatedFileOperation::readStream(), and OFstreamCollator::~OFstreamCollator().
|
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 |
Return reference to the object data.
Definition at line 165 of file autoPtrI.H.
|
inline |
Return const reference to the object data.
Definition at line 180 of file autoPtrI.H.
|
inline |
Const cast to the underlying type reference.
Definition at line 195 of file autoPtrI.H.
|
inline |
Return object pointer.
Definition at line 202 of file autoPtrI.H.
|
inline |
Return const object pointer.
Definition at line 217 of file autoPtrI.H.
|
inline |
Take over the object pointer from parameter.
Definition at line 224 of file autoPtrI.H.
Take over the object pointer from parameter.
Definition at line 231 of file autoPtrI.H.