Public Types | Public Member Functions | Static Public Member Functions | List of all members
autoPtr Class Reference

Pointer management similar to std::unique_ptr, with some additional methods and type checking. More...

Public Types

typedef T element_type
 
typedef Tpointer
 

Public Member Functions

constexpr autoPtr () noexcept
 
constexpr autoPtr (std::nullptr_t) noexcept
 
 autoPtr (T *p) noexcept
 
 autoPtr (autoPtr< T > &&ap) noexcept
 
template<class U >
 autoPtr (autoPtr< U > &&ap)
 
 autoPtr (const autoPtr< T > &ap) noexcept
 
 ~autoPtr () noexcept
 
bool good () const noexcept
 
Tget () noexcept
 
const Tget () const noexcept
 
Tref ()
 
Trelease () noexcept
 
Tptr () noexcept
 
void clear () noexcept
 
void reset (autoPtr< T > &&other) noexcept
 
void reset (T *p=nullptr) noexcept
 
void swap (autoPtr< T > &other) noexcept
 
template<class... Args>
autoPtr< Tclone (Args &&... args) const
 
Toperator* ()
 
const Toperator* () const
 
Toperator-> ()
 
const Toperator-> () const
 
Toperator() ()
 
const Toperator() () const
 
 operator bool () const noexcept
 
 operator const T * () const noexcept
 
 operator T* () noexcept
 
 operator const T & () const
 
void operator= (T *p)=delete
 
void operator= (autoPtr< T > &&ap) noexcept
 
template<class U >
void operator= (autoPtr< U > &&ap) noexcept
 
void operator= (const autoPtr< T > &ap)=delete
 
void operator= (std::nullptr_t) noexcept
 
bool valid () const noexcept
 
bool empty () const noexcept
 
void set (T *p) noexcept
 
template<class... Args>
Foam::autoPtr< TNew (Args &&... args)
 
template<class U , class... Args>
Foam::autoPtr< TNewFrom (Args &&... args)
 
template<class T >
constexpr autoPtr () noexcept
 
template<class T >
constexpr autoPtr (std::nullptr_t) noexcept
 
template<class T >
 autoPtr (T *p) noexcept
 
template<class T >
 autoPtr (autoPtr< T > &&ap) noexcept
 
template<class... Args>
Foam::autoPtr< Tclone (Args &&... args) const
 
template<class T >
void operator= (autoPtr< T > &&ap) noexcept
 
template<class T >
void operator= (std::nullptr_t) noexcept
 

Static Public Member Functions

template<class... Args>
static autoPtr< TNew (Args &&... args)
 
template<class U , class... Args>
static autoPtr< TNewFrom (Args &&... args)
 

Detailed Description

Pointer management similar to std::unique_ptr, with some additional methods and type checking.

Note
Parts of the interface now mirror std::unique_ptr, but since it pre-dates both C++11 and std::unique_ptr, it has some additional idiosyncrasies. The const-reference constructors and assignment operators actually use move semantics to allow their participation in default constructible, default assignable classes.
Source files

Definition at line 49 of file HashPtrTable.H.

Member Typedef Documentation

◆ element_type

typedef T element_type

Definition at line 72 of file autoPtr.H.

◆ pointer

typedef T* pointer

Definition at line 75 of file autoPtr.H.

Constructor & Destructor Documentation

◆ autoPtr() [1/10]

constexpr autoPtr ( )
inlineconstexprnoexcept

◆ autoPtr() [2/10]

constexpr autoPtr ( std::nullptr_t  )
inlineconstexprnoexcept

◆ autoPtr() [3/10]

autoPtr ( T p)
inlineexplicitnoexcept

◆ autoPtr() [4/10]

autoPtr ( autoPtr< T > &&  ap)
inlinenoexcept

◆ autoPtr() [5/10]

autoPtr ( autoPtr< U > &&  ap)
inlineexplicit

Definition at line 75 of file autoPtrI.H.

◆ autoPtr() [6/10]

autoPtr ( const autoPtr< T > &  ap)
inlinenoexcept

Definition at line 123 of file autoPtr.H.

◆ ~autoPtr()

~autoPtr ( )
inlinenoexcept

Definition at line 84 of file autoPtrI.H.

◆ autoPtr() [7/10]

constexpr autoPtr ( )
inlineconstexprnoexcept

Definition at line 46 of file autoPtrI.H.

◆ autoPtr() [8/10]

constexpr autoPtr ( std::nullptr_t  )
inlineconstexprnoexcept

Definition at line 53 of file autoPtrI.H.

◆ autoPtr() [9/10]

autoPtr ( T p)
inlinenoexcept

Definition at line 60 of file autoPtrI.H.

◆ autoPtr() [10/10]

autoPtr ( autoPtr< T > &&  ap)
inlinenoexcept

Definition at line 67 of file autoPtrI.H.

Member Function Documentation

◆ New() [1/2]

static autoPtr<T> New ( Args &&...  args)
inlinestatic

Referenced by polyMeshAdder::add(), zoneCellStencils::allCoupledFacesPatch(), cellToFaceStencil::allCoupledFacesPatch(), cellToCellStencil::allCoupledFacesPatch(), polyTopoChange::changeMesh(), subBody::clone(), solidMixtureProperties::clone(), liquidMixtureProperties::clone(), boundaryPatch::clone(), regionModelFunctionObject::clone(), rigidBody::clone(), cellShape::clone(), solidProperties::clone(), ignitionSite::clone(), pointToPointPlanarInterpolation::clone(), curve::clone(), RASModelVariables::clone(), surfaceZonesInfo::clone(), cellModel::clone(), cellZone::clone(), pointZone::clone(), faPatch::clone(), bitSet::clone(), faceZone::clone(), polyPatch::clone(), dimensionSet::clone(), AMIInterpolation::clone(), coordinateSystem::clone(), particle< Type >::clone(), exprResult::clone(), mapDistribute::clone(), dictionary::clone(), IOobject::clone(), fvMeshDistribute::distribute(), sampledSet::gather(), PDRblock::innerMesh(), IOobjectList::IOobjectList(), Foam::loadPointField(), polyTopoChange::makeMesh(), voxelMeshSearch::makeMesh(), meshRefinement::makePatch(), FIREMeshReader::mesh(), meshReader::mesh(), reader::mesh(), blockMesh::mesh(), lumpedPointIOMovement::New(), motionInterpolation::New(), procLduInterface::New(), lumpedPointController::New(), solidMixtureProperties::New(), surfZone::New(), rigidBody::New(), cellModel::New(), block::New(), colourTable::New(), Time::New(), dictionary::New(), momentum::newField(), age::newField(), ensightCase::newGeometry(), fvMeshTools::newMesh(), zoneCellStencils::nonEmptyFacesPatch(), phaseModel::iNew::operator()(), ignitionSite::iNew::operator()(), passiveParticle::iNew::operator()(), solidParticle::iNew::operator()(), trackedParticle::iNew::operator()(), molecule::iNew::operator()(), particle< Type >::iNew::operator()(), probes::prepare(), genericPatchFieldBase::processEntry(), fvMeshSubset::setCellSubset(), basicSpecieMixture::specieComposition(), polyTopoChanger::topoChangeRequest(), streamLineBase::wallPatch(), and vtkWrite::write().

◆ NewFrom() [1/2]

static autoPtr<T> NewFrom ( Args &&...  args)
inlinestatic

◆ good()

bool good ( ) const
inlinenoexcept

◆ get() [1/2]

T* get ( )
inlinenoexcept

Definition at line 148 of file autoPtr.H.

Referenced by refinementHistory::add(), refinementHistory::apply(), HashPtrTable< exprResult >::insert(), and fvExpressionField::performAction().

Here is the caller graph for this function:

◆ get() [2/2]

const T* get ( ) const
inlinenoexcept

Definition at line 152 of file autoPtr.H.

◆ ref()

T& ref ( )
inline

◆ release()

T * release ( )
inlinenoexcept

◆ ptr()

T* ptr ( )
inlinenoexcept

◆ clear()

void clear ( )
inlinenoexcept

◆ reset() [1/2]

void reset ( autoPtr< T > &&  other)
inlinenoexcept

Referenced by refinementHistory::add(), polyMeshAdder::add(), ATCUaGradU::addATC(), ATCstandard::addATC(), AMIInterpolation::agglomerate(), variablesSet::allocateRenamedField(), refinementHistory::apply(), sensitivityVolBSplinesFI::assembleSensitivities(), sensitivityBezierFI::assembleSensitivities(), sensitivitySurface::assembleSensitivities(), autoPtr< Foam::ThermalDiffusivity >::clear(), PatchInteractionFields< CloudType >::clearOrReset(), writeFile::createFile(), snappySnapDriver::detectNearSurfaces(), distributedTriSurfaceMesh::distribute(), snappySnapDriver::doSnap(), searchablePlateFeatures::features(), sensitivitySurfacePoints::finaliseFaceMultiplier(), distributedTriSurfaceMesh::findNearest(), PatchTools::gatherAndMerge(), distributedTriSurfaceMesh::getVolumeType(), if(), steadyOptimisation::lineSearchUpdate(), polyTopoChange::makeMesh(), rigidBodyModel::merge(), lineSearch::New(), isoSurfaceBase::New(), entry::New(), functionObjectList::New(), Foam::vtk::newFormatter(), masterUncollatedFileOperation::NewIFstream(), Foam::NewOrNone(), processorCyclicPolyPatch::order(), fvExpressionField::performAction(), projectCurveEdge::position(), projectEdge::position(), projectFace::project(), radiativeIntensityRay::radiativeIntensityRay(), decomposedBlockData::read(), functionObjectList::read(), BilgerMixtureFraction::read(), masterUncollatedFileOperation::read(), decomposedBlockData::readBlock(), decomposedBlockData::readBlocks(), masterUncollatedFileOperation::readStream(), autoPtr< Foam::ThermalDiffusivity >::set(), cyclicAMIPolyPatch::setAMIFaces(), variablesSet::setFluxField(), sensitivitySurface::smoothSensitivities(), objective::updateNormalizationFactor(), histogram::write(), Foam::ensightOutput::writeCloudPositions(), externalCoupled::writeGeometry(), and decomposedBlockData::writeObject().

◆ reset() [2/2]

void reset ( T p = nullptr)
inlinenoexcept

◆ swap()

void swap ( autoPtr< T > &  other)
inlinenoexcept

Definition at line 121 of file autoPtrI.H.

◆ clone() [1/2]

autoPtr<T> clone ( Args &&...  args) const
inline

Referenced by mapPolyMesh::mapPolyMesh().

Here is the caller graph for this function:

◆ operator*() [1/2]

T & operator* ( )
inline

Definition at line 147 of file autoPtrI.H.

Referenced by autoPtr< Foam::ThermalDiffusivity >::operator const T &().

Here is the caller graph for this function:

◆ operator*() [2/2]

const T & operator* ( ) const
inline

Definition at line 160 of file autoPtrI.H.

◆ operator->() [1/2]

T * operator-> ( )
inline

Definition at line 167 of file autoPtrI.H.

◆ operator->() [2/2]

const T * operator-> ( ) const
inline

Definition at line 180 of file autoPtrI.H.

◆ operator()() [1/2]

T & operator() ( )
inline

Definition at line 187 of file autoPtrI.H.

◆ operator()() [2/2]

const T & operator() ( ) const
inline

Definition at line 194 of file autoPtrI.H.

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

Definition at line 225 of file autoPtr.H.

◆ operator const T *()

operator const T * ( ) const
inlinenoexcept

Definition at line 228 of file autoPtr.H.

◆ operator T*()

operator T* ( )
inlinenoexcept

Definition at line 231 of file autoPtr.H.

◆ operator const T &()

operator const T & ( ) const
inline

Definition at line 239 of file autoPtr.H.

◆ operator=() [1/7]

void operator= ( T p)
delete

◆ operator=() [2/7]

void operator= ( autoPtr< T > &&  ap)
inlinenoexcept

◆ operator=() [3/7]

void operator= ( autoPtr< U > &&  ap)
inlinenoexcept

Definition at line 213 of file autoPtrI.H.

◆ operator=() [4/7]

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

◆ operator=() [5/7]

void operator= ( std::nullptr_t  )
inlinenoexcept

◆ valid()

bool valid ( ) const
inlinenoexcept

Definition at line 268 of file autoPtr.H.

Referenced by cyclicAMIPolyPatch::interpolate(), objective::JCycle(), histogram::write(), and objective::write().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inlinenoexcept

Definition at line 274 of file autoPtr.H.

◆ set()

void set ( T p)
inlinenoexcept

◆ New() [2/2]

Foam::autoPtr<T> New ( Args &&...  args)
inline

Definition at line 29 of file autoPtrI.H.

◆ NewFrom() [2/2]

Foam::autoPtr<T> NewFrom ( Args &&...  args)
inline

Definition at line 37 of file autoPtrI.H.

◆ clone() [2/2]

Foam::autoPtr<T> clone ( Args &&...  args) const
inline

Definition at line 133 of file autoPtrI.H.

◆ operator=() [6/7]

void operator= ( autoPtr< T > &&  ap)
inlinenoexcept

Definition at line 201 of file autoPtrI.H.

◆ operator=() [7/7]

void operator= ( std::nullptr_t  )
inlinenoexcept

Definition at line 224 of file autoPtrI.H.


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