Pointer management similar to std::unique_ptr, with some additional methods and type checking. More...
Public Types | |
| typedef T | element_type |
| Type of object being managed. More... | |
| typedef T * | pointer |
| Pointer to type of object being managed. More... | |
Public Member Functions | |
| constexpr | autoPtr () noexcept |
| Construct with no managed pointer. More... | |
| constexpr | autoPtr (std::nullptr_t) noexcept |
| Implicit construct from literal nullptr: no managed pointer. More... | |
| autoPtr (T *p) noexcept | |
| Construct, taking ownership of the pointer. More... | |
| autoPtr (autoPtr< T > &&rhs) noexcept | |
| Move construct, transferring ownership. More... | |
| template<class U > | |
| autoPtr (autoPtr< U > &&rhs) | |
| Move construct, transferring ownership from derived type. More... | |
| autoPtr (std::unique_ptr< T > &&rhs) noexcept | |
| Move construct from unique_ptr, transferring ownership. More... | |
| autoPtr (const autoPtr< T > &rhs) noexcept | |
| A move construct disguised as a copy construct (transfers ownership) More... | |
| ~autoPtr () noexcept | |
| Destructor: deletes managed pointer. More... | |
| bool | good () const noexcept |
| True if the managed pointer is non-null. More... | |
| T * | get () noexcept |
| Return pointer to managed object without nullptr checking. More... | |
| const T * | get () const noexcept |
| Return const pointer to managed object without nullptr checking. More... | |
| T & | ref () |
| Return reference to the managed object without nullptr checking. More... | |
| T * | release () noexcept |
| Release ownership and return the pointer. More... | |
| T * | ptr () noexcept |
Same as release(). More... | |
| void | clear () noexcept |
Same as reset(nullptr) More... | |
| void | reset (T *p=nullptr) noexcept |
| Delete managed object and set to new given pointer. More... | |
| void | reset (autoPtr< T > &&other) noexcept |
| Delete managed object and set to new given pointer. More... | |
| template<class... Args> | |
| T & | emplace (Args &&... args) |
| Reset with emplace construction. Return reference to the new content. More... | |
| void | swap (autoPtr< T > &other) noexcept |
| Swaps the managed object with other autoPtr. More... | |
| template<class... Args> | |
| autoPtr< T > | clone (Args &&... args) const |
| Copy construct by invoking clone on underlying managed object. More... | |
| T & | operator* () |
| Return reference to the managed object. More... | |
| const T & | operator* () const |
| Return const reference to the object. More... | |
| T * | operator-> () |
| Dereferences (non-const) pointer to the managed object. More... | |
| const T * | operator-> () const |
| Dereferences (const) pointer to the managed object. More... | |
| T & | operator() () |
| Return reference to the object data. More... | |
| const T & | operator() () const |
| Return const reference to the object data. More... | |
| operator bool () const noexcept | |
| True if pointer/reference is non-null. Same as good() More... | |
| operator const T * () const noexcept | |
| Implicit cast to const pointer type. More... | |
| operator const T & () const | |
| Deprecated(2019-01) Automatic cast conversion to underlying type. More... | |
| void | operator= (T *p)=delete |
| No copy assignment from plain pointer (uncontrolled access) More... | |
| void | operator= (const autoPtr< T > &)=delete |
| No move assignment disguised as a copy assignment. More... | |
| void | operator= (autoPtr< T > &&other) noexcept |
| Transfer object ownership from parameter. More... | |
| template<class U > | |
| void | operator= (autoPtr< U > &&other) noexcept |
| Transfer object ownership from parameter. More... | |
| void | operator= (std::unique_ptr< T > &&other) |
| Transfer ownership by move assignment from unique_ptr. More... | |
| void | operator= (std::nullptr_t) noexcept |
| Reset via assignment from literal nullptr. More... | |
| bool | valid () const noexcept |
| Identical to good(), or bool operator. More... | |
| bool | empty () const noexcept |
| Deprecated(2020-07) True if the managed pointer is null. More... | |
| void | set (T *p) noexcept |
| Deprecated(2018-02) Identical to reset(). More... | |
| template<class... Args> | |
| Foam::autoPtr< T > | clone (Args &&... args) const |
Static Public Member Functions | |
| template<class... Args> | |
| static autoPtr< T > | New (Args &&... args) |
| Construct autoPtr with forwarding arguments. More... | |
| template<class U , class... Args> | |
| static autoPtr< T > | NewFrom (Args &&... args) |
| Construct autoPtr from derived type with forwarding arguments. More... | |
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
| typedef T element_type |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
Construct autoPtr with forwarding arguments.
| args | list of arguments with which an instance of T will be constructed. |
Definition at line 178 of file autoPtr.H.
References args, and Foam::T().
Referenced by polyMeshAdder::add(), cellToCellStencil::allCoupledFacesPatch(), cellToFaceStencil::allCoupledFacesPatch(), zoneCellStencils::allCoupledFacesPatch(), holeToFace::calcClosure(), polyTopoChange::changeMesh(), boundaryPatch::clone(), ignitionSite::clone(), particle< Type >::clone(), surfaceZonesInfo::clone(), AMIInterpolation::clone(), curve::clone(), pointToPointPlanarInterpolation::clone(), bitSet::clone(), dictionary::clone(), IOobject::clone(), dimensionSet::clone(), exprResult::clone(), cellModel::clone(), cellShape::clone(), mapDistribute::clone(), coordinateSystem::clone(), RASModelVariables::clone(), regionModelFunctionObject::clone(), rigidBody::clone(), subBody::clone(), liquidMixtureProperties::clone(), solidMixtureProperties::clone(), solidProperties::clone(), cellZone::clone(), faPatch::clone(), faceZone::clone(), polyPatch::clone(), pointZone::clone(), box::createMap(), Foam::createReconstructMap(), cyclicAMIPolyPatch::cylindricalCS(), fvMeshDistribute::distribute(), multiphaseSystem::dragCoeffs(), coordSet::gatherSort(), externalDisplacementMeshMover::getPatch(), PDRblock::innerMesh(), IOobjectList::IOobjectList(), Foam::loadPointField(), distributedTriSurfaceMesh::localQueries(), polyTopoChange::makeMesh(), voxelMeshSearch::makeMesh(), meshRefinement::makePatch(), blockMesh::mesh(), meshReader::mesh(), FIREMeshReader::mesh(), reader::mesh(), Time::New(), liquidMixtureProperties::New(), solidMixtureProperties::New(), lumpedPointController::New(), solidProperties::New(), block::New(), triSurface::New(), motionInterpolation::New(), lumpedPointIOMovement::New(), rigidBody::New(), dynamicTopODesignVariables::New(), topODesignVariables::New(), colourTable::New(), dictionary::New(), procLduInterface::New(), cellModel::New(), surfZone::New(), momentum::newField(), Time::NewGlobalTime(), fvMeshTools::newMesh(), faMeshTools::newMesh(), zoneCellStencils::nonEmptyFacesPatch(), phaseModel::iNew::operator()(), ignitionSite::iNew::operator()(), injectedParticle::iNew::operator()(), particle< Type >::iNew::operator()(), passiveParticle::iNew::operator()(), molecule::iNew::operator()(), solidParticle::iNew::operator()(), trackedParticle::iNew::operator()(), passivePositionParticle::iNew::operator()(), mappedPatchBase::readDatabase(), UnsortedMeshedSurface< Face >::releaseZoneIds(), fvMeshSubset::reset(), basicSpecieMixture::specieComposition(), polyTopoChanger::topoChangeRequest(), faMesh::TryNew(), streamLineBase::wallPatch(), vtkWrite::write(), and seriesWriter::write().

|
inlinenoexcept |
True if the managed pointer is non-null.
Definition at line 206 of file autoPtr.H.
References bool.
Referenced by AMIInterpolation::calcDistribution(), UniformValueField< Type >::good(), writeFile::newFile(), writeFile::newFileAtTime(), argList::parse(), uncollatedFileOperation::readHeader(), masterUncollatedFileOperation::readStream(), uncollatedFileOperation::readStream(), Table< Type >::Table(), objectiveIncompressible::update_dJdTMvar(), FIREMeshWriter::write(), FLMAsurfaceFormat< Face >::write(), and decomposedBlockData::writeBlocks().

|
inlinenoexcept |
Return pointer to managed object without nullptr checking.
Pointer remains under autoPtr management.
Definition at line 216 of file autoPtr.H.
Referenced by refinementHistory::add(), refinementHistory::apply(), fvExpressionField::performAction(), and fieldsDistributor::readFields().

|
inlinenoexcept |
|
inline |
Return reference to the managed object without nullptr checking.
When get() == nullptr, additional guards may be required to avoid inadvertent access of a nullptr.
Definition at line 231 of file autoPtr.H.
Referenced by energySpectrum::calcAndWriteSpectrum(), pointPatchField< Type >::New(), TDACChemistryModel< ReactionThermo, ThermoType >::TDACChemistryModel(), objectiveForce::update_dxdbMultiplier(), objectiveMoment::update_dxdbMultiplier(), ParticleHistogram< CloudType >::write(), and ParticlePostProcessing< CloudType >::write().

|
inlinenoexcept |
Release ownership and return the pointer.
Definition at line 28 of file autoPtrI.H.
Referenced by PtrList< T >::append(), fvExpressionField::performAction(), autoPtr< T >::ptr(), PtrDynList< T, SizeMin >::set(), PtrList< T >::set(), PtrListDictionary< T >::set(), and regIOobject::store().

|
inlinenoexcept |
Same as release().
Definition at line 248 of file autoPtr.H.
References autoPtr< T >::release().
Referenced by variablesSet::allocateField(), variablesSet::allocateFluxField(), rigidBodyModel::join(), lduPrimitiveMesh::lduPrimitiveMesh(), faceAreaPairGAMGAgglomeration::movePoints(), and OFstreamCollator::write().


|
inlinenoexcept |
Same as reset(nullptr)
Definition at line 255 of file autoPtr.H.
References autoPtr< T >::reset().
Referenced by cyclicACMIGAMGInterface::cyclicACMIGAMGInterface(), cyclicAMIGAMGInterface::cyclicAMIGAMGInterface(), meshRefinement::distribute(), snappySnapDriver::doSnap(), reactingMixture< ThermoType >::reactingMixture(), masterUncollatedFileOperation::readStream(), FIREMeshWriter::write(), and FLMAsurfaceFormat< Face >::write().


|
inlinenoexcept |
Delete managed object and set to new given pointer.
Definition at line 37 of file autoPtrI.H.
References p.
Referenced by polyMeshAdder::add(), refinementHistory::add(), ATCUaGradU::addATC(), AMIInterpolation::agglomerate(), variablesSet::allocateRenamedField(), refinementHistory::apply(), shapeDesignVariables::assembleSensitivities(), AMIInterpolation::calcDistribution(), autoPtr< T >::clear(), PatchInteractionFields< CloudType >::clearOrReset(), cyclicACMIGAMGInterface::cyclicACMIGAMGInterface(), cyclicAMIGAMGInterface::cyclicAMIGAMGInterface(), designVariables::designVariables(), designVariablesUpdate::designVariablesUpdate(), snappySnapDriver::detectNearSurfaces(), faMeshDistributor::distribute(), distributedTriSurfaceMesh::distribute(), snappySnapDriver::doSnap(), searchablePlateFeatures::features(), distributedTriSurfaceMesh::findNearest(), PatchTools::gatherAndMerge(), distributedTriSurfaceMesh::getVolumeType(), if(), cyclicAMIPolyPatch::initInterpolate(), cyclicAMIPolyPatch::interpolate(), optimisationManager::lineSearchUpdate(), polyTopoChange::makeMesh(), rigidBodyModel::merge(), averageNeighbourFvGeometryScheme::movePoints(), MultiComponentPhaseModel< BasePhaseModel, phaseThermo >::MultiComponentPhaseModel(), functionObjectList::New(), lineSearch::New(), isoSurfaceBase::New(), entry::New(), writeFile::newFile(), writeFile::newFileAtTime(), Foam::vtk::newFormatter(), masterUncollatedFileOperation::NewIFstream(), Foam::NewOrNone(), nullSpace::nullSpace(), autoPtr< T >::operator=(), processorCyclicPolyPatch::order(), fvExpressionField::performAction(), projectCurveEdge::position(), projectEdge::position(), ISQP::preconVectorProduct(), projectFace::project(), PurePhaseModel< BasePhaseModel, phaseThermo >::PurePhaseModel(), radiativeIntensityRay::radiativeIntensityRay(), functionObjectList::read(), decomposedBlockData::read(), BilgerMixtureFraction::read(), masterUncollatedFileOperation::read(), decomposedBlockData::readBlock(), decomposedBlockData::readBlocks(), volumetricBSplinesDesignVariables::readBounds(), masterUncollatedFileOperation::readStream(), Foam::reconstructLagrangian(), Foam::redistributeLagrangian(), autoPtr< T >::set(), cyclicAMIPolyPatch::setAMIFaces(), BezierDesignVariables::setBounds(), variablesSet::setFluxField(), sensitivitySurface::smoothSensitivities(), objective::updateNormalizationFactor(), Foam::ensightOutput::writeCloudPositions(), externalCoupled::writeGeometry(), decomposedBlockData::writeObject(), and topOVariablesBase::writeSurfaceFiles().
Delete managed object and set to new given pointer.
Definition at line 45 of file autoPtrI.H.
References reset().

|
inline |
Reset with emplace construction. Return reference to the new content.
Definition at line 59 of file autoPtrI.H.
Swaps the managed object with other autoPtr.
Definition at line 68 of file autoPtrI.H.
Copy construct by invoking clone on underlying managed object.
A no-op if no pointer is managed
| args | list of arguments for clone |
Referenced by mapPolyMesh::mapPolyMesh().

|
inline |
Return reference to the managed object.
FatalError if no pointer is managed
Definition at line 94 of file autoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and T.
Referenced by autoPtr< chemistryReader< ThermoType > >::operator const chemistryReader< ThermoType > &().


|
inline |
Return const reference to the object.
FatalError if no pointer is managed
Definition at line 107 of file autoPtrI.H.
|
inline |
Dereferences (non-const) pointer to the managed object.
FatalError if no pointer is managed
Definition at line 114 of file autoPtrI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, Foam::name(), and T.

|
inline |
Dereferences (const) pointer to the managed object.
FatalError if no pointer is managed
Definition at line 127 of file autoPtrI.H.
|
inline |
Return reference to the object data.
FatalError if no pointer is managed
Definition at line 134 of file autoPtrI.H.
References Foam::operator*().

|
inline |
Return const reference to the object data.
FatalError if no pointer is managed
Definition at line 141 of file autoPtrI.H.
References Foam::operator*().

|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inline |
Deprecated(2019-01) Automatic cast conversion to underlying type.
FatalError if no pointer is managed
|
delete |
No copy assignment from plain pointer (uncontrolled access)
No move assignment disguised as a copy assignment.
Transfer object ownership from parameter.
Definition at line 386 of file autoPtr.H.
References autoPtr< T >::reset().

Transfer object ownership from parameter.
Definition at line 394 of file autoPtr.H.
References autoPtr< T >::reset().

|
inline |
Transfer ownership by move assignment from unique_ptr.
Definition at line 402 of file autoPtr.H.
References autoPtr< T >::reset().

|
inlinenoexcept |
Reset via assignment from literal nullptr.
Definition at line 407 of file autoPtr.H.
References autoPtr< T >::reset().

|
inlinenoexcept |
|
inlinenoexcept |
Deprecated(2020-07) True if the managed pointer is null.
Definition at line 424 of file autoPtr.H.
Referenced by MultiComponentPhaseModel< BasePhaseModel, phaseThermo >::MultiComponentPhaseModel().

|
inlinenoexcept |
Deprecated(2018-02) Identical to reset().
Definition at line 437 of file autoPtr.H.
References p, and autoPtr< T >::reset().
Referenced by BlendedInterfacialModel< ModelType >::BlendedInterfacialModel().


|
inline |
Definition at line 80 of file autoPtrI.H.
References args.