|
constexpr | tmp () noexcept |
| Default construct, no managed pointer. More...
|
|
constexpr | tmp (std::nullptr_t) noexcept |
| Construct with no managed pointer. More...
|
|
| tmp (T *p) |
| Construct, taking ownership of the pointer. More...
|
|
constexpr | tmp (const T &obj) noexcept |
| Construct for a const reference to an object. More...
|
|
| tmp (tmp< T > &&rhs) noexcept |
| Move construct, transferring ownership. More...
|
|
| tmp (const tmp< T > &&rhs) noexcept |
| Move construct, transferring ownership. More...
|
|
| tmp (const tmp< T > &rhs) |
| Copy construct, incrementing ref-count of managed pointer. More...
|
|
| tmp (const tmp< T > &rhs, bool reuse) |
| Copy/move construct. Optionally reusing ref-counted pointer. More...
|
|
| ~tmp () |
| Destructor: deletes managed pointer when the ref-count is 0. More...
|
|
bool | empty () const noexcept |
| Deprecated(2020-07) True if a null managed pointer. More...
|
|
bool | valid () const noexcept |
| True for non-null pointer/reference. More...
|
|
bool | is_pointer () const noexcept |
| True if this is a managed pointer (not a reference) More...
|
|
bool | isTmp () const noexcept |
| Identical to is_pointer() More...
|
|
bool | movable () const noexcept |
| True if this is a non-null managed pointer with a unique ref-count. More...
|
|
T * | get () noexcept |
| Return pointer without nullptr checking. More...
|
|
const T * | get () const noexcept |
| Return const pointer without nullptr checking. More...
|
|
const T & | cref () const |
|
T & | ref () const |
|
T & | constCast () const |
|
T * | ptr () const |
| Return managed pointer for reuse, or clone() the object reference. More...
|
|
void | clear () const noexcept |
|
void | reset (T *p=nullptr) noexcept |
| Delete managed temporary object and set to new given pointer. More...
|
|
void | reset (tmp< T > &&other) noexcept |
| Clear existing and transfer ownership. More...
|
|
void | cref (const T &obj) noexcept |
| Delete managed temporary object and set to (const) reference. More...
|
|
void | ref (T &obj) noexcept |
| Delete managed temporary object and set to (non-const) reference. More...
|
|
void | swap (tmp< T > &other) noexcept |
| Swaps the managed object with other. More...
|
|
const T * | operator-> () const |
| Dereferences (const) pointer to the managed object. More...
|
|
T * | operator-> () |
| Dereferences (non-const) pointer to the managed object. More...
|
|
const T & | operator() () const |
| Return const reference to the object - same as cref() method. More...
|
|
| operator const T & () const |
| Cast to underlying data type, using the cref() method. More...
|
|
| operator bool () const noexcept |
| Non-null pointer/reference : valid() More...
|
|
void | operator= (const tmp< T > &other) |
| Transfer ownership of the managed pointer. More...
|
|
void | operator= (tmp< T > &&other) noexcept |
| Clear existing and transfer ownership. More...
|
|
void | operator= (T *p) |
| Take ownership of the pointer. More...
|
|
void | operator= (std::nullptr_t) noexcept |
| Reset via assignment from literal nullptr. More...
|
|
template<class... Args> |
Foam::tmp< T > | New (Args &&... args) |
|
template<class U , class... Args> |
Foam::tmp< T > | NewFrom (Args &&... args) |
|
template<class T>
class Foam::tmp< T >
A class for managing temporary objects.
This is a combination of std::shared_ptr (with intrusive ref-counting) and a shared_ptr without ref-counting and null deleter. This allows the tmp to double as a pointer management and an indirect pointer to externally allocated objects.
- Source files
-
- See also
- Foam::autoPtr Foam::refPtr Foam::refCount
Definition at line 61 of file PtrList.H.
Return non-const reference to the contents of a non-null managed pointer.
Fatal for a null managed pointer or if the object is const.
Definition at line 228 of file tmpI.H.
Referenced by faMatrix< Type >::A(), fvMatrix< Type >::A(), MRFZoneList::absolute(), multiBandZoneAbsorptionEmission::aCont(), greyMeanAbsorptionEmission::aCont(), wideBandAbsorptionEmission::aCont(), phaseChange::addToDriftRate(), cloudAbsorptionEmission::aDisp(), adjointSensitivity::adjointMeshMovementSource(), pairGAMGAgglomeration::agglomerate(), GAMGInterface::agglomerateCoeffs(), adjointSolverManager::aggregateSensitivities(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::alpha(), phaseSystem::alphaEff(), phaseSystem::alphahe(), MassTransferPhaseSystem< BasePhaseSystem >::alphaTransfer(), ThermoCloud< Foam::DSMCCloud >::ap(), polyPatch::areaFraction(), Foam::atan2(), Foam::fac::average(), Foam::fvc::average(), averageNeighbourFvGeometryScheme::averageCentres(), averageNeighbourFvGeometryScheme::averageNeighbourCentres(), alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::calcAlphat(), subtract::calcFieldType(), add::calcFieldType(), faceLimitedGrad< Type >::calcGrad(), faceMDLimitedGrad< Type >::calcGrad(), cellMDLimitedGrad< Type >::calcGrad(), curvatureSeparation::calcInvR1(), nutkWallFunctionFvPatchScalarField::calcNut(), nutUWallFunctionFvPatchScalarField::calcNut(), nutkRoughWallFunctionFvPatchScalarField::calcNut(), nutUSpaldingWallFunctionFvPatchScalarField::calcNut(), phaseSystem::calcPhi(), StandardChemistryModel< ReactionThermo, ThermoType >::calculateRR(), nutUTabulatedWallFunctionFvPatchScalarField::calcUPlus(), nutkFilmWallFunctionFvPatchScalarField::calcUTau(), nutUBlendedWallFunctionFvPatchScalarField::calcUTau(), nutUSpaldingWallFunctionFvPatchScalarField::calcUTau(), nutUWallFunctionFvPatchScalarField::calcYPlus(), primitiveMeshTools::cellDeterminant(), Foam::cmptMag(), optimisationType::computeDirection(), NURBS3DVolume::computeNewBoundaryPoints(), NURBS3DVolume::computeNewPoints(), NURBS3DVolume::computeParametricCoordinates(), Foam::constrainHbyA(), adjointSolverManager::constraintValues(), forceList::correct(), thermocapillaryForce::correct(), contactAngleForce::correct(), Maxwell< BasicTurbulenceModel >::correct(), DeardorffDiffStress< BasicTurbulenceModel >::correct(), ShihQuadraticKE::correct(), LamBremhorstKE::correct(), LienLeschziner::correct(), kOmega< BasicTurbulenceModel >::correct(), SpalartAllmaras< BasicTurbulenceModel >::correct(), LienCubicKE::correct(), SSG< BasicTurbulenceModel >::correct(), realizableKE< BasicTurbulenceModel >::correct(), kEpsilon< EddyDiffusivity< compressible::turbulenceModel > >::correct(), RNGkEpsilon< BasicTurbulenceModel >::correct(), LaunderSharmaKE< BasicTurbulenceModel >::correct(), LRR< BasicTurbulenceModel >::correct(), qZeta::correct(), SpalartAllmarasDES< BasicTurbulenceModel >::correct(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::correct(), mixtureKEpsilon< BasicTurbulenceModel >::correct(), kkLOmega::correct(), kEpsilonPhitF< BasicTurbulenceModel >::correct(), adjointSpalartAllmaras::correct(), kOmegaSSTBase< eddyViscosity< RASModel< BasicTurbulenceModel > > >::correct(), fourthLnGrad< Type >::correction(), correctedLnGrad< Type >::correction(), cubic< Type >::correction(), pointLinear< Type >::correction(), CentredFitSnGradScheme< Type, Polynomial, Stencil >::correction(), faceCorrectedSnGrad< Type >::correction(), correctedSnGrad< Type >::correction(), deferredCorrection< Type >::correction(), outletStabilised< Type >::correction(), MassTransferPhaseSystem< BasePhaseSystem >::correctMassSources(), kOmegaSSTLM< BasicTurbulenceModel >::correctReThetatGammaInt(), constantFilmThermo::Cp(), phaseSystem::Cp(), heThermo< BasicSolidThermo, MixtureType >::CpByCpv(), phaseSystem::CpByCpv(), heThermo< BasicSolidThermo, MixtureType >::Cpv(), phaseSystem::Cpv(), cellCellStencil::createField(), Foam::fvc::curl(), multiSolidBodyMotionSolver::curPoints(), solidBodyMotionSolver::curPoints(), volumetricBSplinesMotionSolver::curPoints(), velocityComponentLaplacianFvMotionSolver::curPoints(), displacementComponentLaplacianFvMotionSolver::curPoints(), displacementSBRStressFvMotionSolver::curPoints(), sixDoFRigidBodyMotionSolver::curPoints(), displacementInterpolationMotionSolver::curPoints(), phaseSystem::Cv(), multiphaseSystem::Cvm(), faMatrix< Type >::D(), fvMatrix< Type >::D(), fvMatrix< Type >::DD(), MomentumTransferPhaseSystem< BasePhaseSystem >::ddtCorrByAs(), fvFieldDecomposer::decomposeField(), cyclicFvPatch::delta(), cyclicFaPatch::delta(), fvMesh::delta(), blackBodyEmission::deltaLambdaT(), nonlinearEddyViscosity< incompressible::RASModel >::devRhoReff(), adjointSpalartAllmaras::diffusionCoeffVar1(), adjointSpalartAllmaras::distanceSensitivities(), Foam::fac::div(), NURBS3DVolume::dndbBasedSensitivities(), adjointSpalartAllmaras::dr_dDelta(), adjointSpalartAllmaras::dr_dNuTilda(), adjointSpalartAllmaras::dr_dStilda(), SpalartAllmarasDES< BasicTurbulenceModel >::dTilda(), shapeSensitivities::dvdbMult(), blackBodyEmission::EbDeltaLambdaT(), multiBandZoneAbsorptionEmission::eCont(), greyMeanAbsorptionEmission::ECont(), wideBandAbsorptionEmission::ECont(), faMesh::edgeLengthCorrection(), faPatch::edgeNormals(), ThermoCloud< Foam::DSMCCloud >::Ep(), LESeddyViscosity< BasicTurbulenceModel >::epsilon(), edgeInterpolationScheme< scalar >::euclidianInterpolate(), scalarTransport::execute(), kOmegaSSTBase< eddyViscosity< RASModel< BasicTurbulenceModel > > >::F23(), EulerFaD2dt2Scheme< Type >::facD2dt2(), EulerFaDdtScheme< Type >::facDdt(), backwardFaDdtScheme< Type >::facDdt(), boundedBackwardFaDdtScheme::facDdt(), EulerFaDdtScheme< Type >::facDdt0(), backwardFaDdtScheme< Type >::facDdt0(), boundedBackwardFaDdtScheme::facDdt0(), gaussConvectionScheme< Type >::facDiv(), polyPatch::faceCellCentres(), primitiveMeshTools::faceConcavity(), lduMatrix::faceH(), PatchToPatchInterpolation< FromPatch, ToPatch >::faceInterpolate(), cellQuality::faceNonOrthogonality(), primitiveMeshTools::faceOrthogonality(), mappedPatchBase::facePoints(), polyMeshTools::faceSkewness(), cellQuality::faceSkewness(), primitiveMeshTools::faceSkewness(), PrimitivePatchInterpolation< Foam::PrimitivePatch >::faceToPointInterpolate(), gaussLaplacianScheme< Type >::facLaplacian(), EulerFaD2dt2Scheme< Type >::famD2dt2(), EulerFaDdtScheme< Type >::famDdt(), backwardFaDdtScheme< Type >::famDdt(), boundedBackwardFaDdtScheme::famDdt(), gaussConvectionScheme< Type >::famDiv(), gaussLaplacianScheme< Type >::famLaplacian(), Foam::edgeMeshTools::featureProximity(), volPointInterpolation::flatBoundaryField(), faMatrix< Type >::flux(), fvMatrix< Type >::flux(), correctedSnGrad< Type >::fullGradCorrection(), faceCorrectedSnGrad< Type >::fullGradCorrection(), skewCorrectedSnGrad< Type >::fullGradCorrection(), EulerDdtScheme< Type >::fvcDdt(), CoEulerDdtScheme< Type >::fvcDdt(), SLTSDdtScheme< Type >::fvcDdt(), backwardDdtScheme< Type >::fvcDdt(), ddtScheme< Type >::fvcDdtPhiCoeff(), ddtScheme< Type >::fvcDdtPhiCoeffExperimental(), steadyStateDdtScheme< Type >::fvcDdtPhiCorr(), steadyStateDdtScheme< Type >::fvcDdtUfCorr(), gaussConvectionScheme< Type >::fvcDiv(), gaussLaplacianScheme< Type, GType >::fvcLaplacian(), EulerD2dt2Scheme< Type >::fvmD2dt2(), EulerDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), backwardDdtScheme< Type >::fvmDdt(), SLTSDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), heThermo< BasicSolidThermo, MixtureType >::gamma(), phaseSystem::gamma(), pyrolysisChemistryModel< CompType, SolidThermo, GasThermo >::gasHs(), fvMeshDistribute::generateTestField(), NURBS3DVolume::getDxCellsDb(), NURBS3DVolume::getDxDb(), cylindrical::globalToLocal(), kinematicSingleLayer::gNormClipped(), Foam::fac::grad(), lduMatrix::H(), faMatrix< Type >::H(), fvMatrix< Type >::H(), heThermo< BasicSolidThermo, MixtureType >::hc(), phaseSystem::hc(), heThermo< BasicSolidThermo, MixtureType >::he(), MassTransferPhaseSystem< BasePhaseSystem >::heatTransfer(), AnisothermalPhaseModel< BasePhaseModel >::heEqn(), heheuPsiThermo< BasicPsiThermo, MixtureType >::heu(), coalCloudList::hsTrans(), InterfaceCompositionPhaseChangePhaseSystem< BasePhaseSystem >::iDmdt(), GAMGInterface::interfaceInternalField(), lduPrimitiveProcessorInterface::interfaceInternalField(), cyclicACMIGAMGInterface::internalFieldTransfer(), cyclicAMIGAMGInterface::internalFieldTransfer(), cyclicGAMGInterface::internalFieldTransfer(), cyclicFaPatch::internalFieldTransfer(), pointToPointPlanarInterpolation::interpolate(), pointVolInterpolation::interpolate(), localMax< Type >::interpolate(), localMin< Type >::interpolate(), edgeInterpolationScheme< scalar >::interpolate(), surfaceInterpolationScheme< GType >::interpolate(), singleCellFvMesh::interpolate(), Foam::inv(), ReynoldsStress< RASModel< BasicTurbulenceModel > >::k(), SpalartAllmarasDES< BasicTurbulenceModel >::k(), phaseSystem::K(), heSolidThermo< BasicSolidThermo, MixtureType >::Kappa(), liquidFilmThermo::kappa(), constantFilmThermo::kappa(), phaseSystem::kappa(), kineticGasEvaporation< Thermo, OtherThermo >::Kexp(), boundaryAdjointContributionIncompressible::laminarDiffusivity(), Foam::levelSetFraction(), steadyOptimisation::lineSearchUpdate(), lnGradScheme< Type >::lnGrad(), Foam::fvc::magSqrGradGrad(), mappedPatchFieldBase< scalar >::mappedInternalField(), mappedPatchFieldBase< scalar >::mappedWeightField(), meshToMesh::mapSrcToTgt(), meshToMesh::mapTgtToSrc(), momentOfInertia::meshInertia(), CoEulerDdtScheme< Type >::meshPhi(), SLTSDdtScheme< Type >::meshPhi(), localEulerDdtScheme< Type >::meshPhi(), boundaryAdjointContributionIncompressible::momentumDiffusion(), regionModel1D::moveMesh(), fvMesh::movePoints(), primitiveMesh::movePoints(), liquidFilmThermo::mu(), constantFilmThermo::mu(), phaseSystem::mu(), heheuPsiThermo< BasicPsiThermo, MixtureType >::mub(), heheuPsiThermo< BasicPsiThermo, MixtureType >::muu(), Foam::fac::ndiv(), multiphaseSystem::nearInterface(), faPatchField< Type >::New(), fvPatchField< vector >::New(), Foam::fac::ngrad(), cellQuality::nonOrthogonality(), dynamicOversetFvMesh::normalisation(), Schaeffer::nu(), JohnsonJacksonSchaeffer::nu(), multiphaseSystem::nu(), phaseSystem::nu(), consumptionSpeed::omega0Sigma(), anisotropicFilter::operator()(), optionList::operator()(), RaviPetersen::operator()(), fvPatch::patchInternalField(), faPatch::patchInternalField(), jumpCyclicFvPatchField< vector >::patchNeighbourField(), cyclicFaPatchField< Type >::patchNeighbourField(), cyclicFvPatchField< vector >::patchNeighbourField(), cyclicAMIFvPatchField< scalar >::patchNeighbourField(), cyclicACMIFvPatchField< Type >::patchNeighbourField(), PatchToPatchInterpolation< FromPatch, ToPatch >::pointInterpolate(), PatchTools::pointNormals(), PrimitivePatchInterpolation< Foam::PrimitivePatch >::pointToFaceInterpolate(), Foam::pow(), phasePressureModel::pPrime(), kineticTheoryModel::pPrime(), phasePressureModel::pPrimef(), boundaryAdjointContributionIncompressible::pressureSource(), SpalartAllmarasDES< BasicTurbulenceModel >::psi(), heheuPsiThermo< BasicPsiThermo, MixtureType >::psib(), heheuPsiThermo< BasicPsiThermo, MixtureType >::psiu(), laminar< ReactionThermo >::Qdot(), EDC< ReactionThermo >::Qdot(), diffusionMulticomponent< ReactionThermo, ThermoType >::Qdot(), solidChemistryModel< CompType, SolidThermo >::Qdot(), StandardChemistryModel< ReactionThermo, ThermoType >::Qdot(), greyDiffusiveViewFactorFixedValueFvPatchScalarField::qro(), nonlinearEddyViscosity< incompressible::RASModel >::R(), laminar< ReactionThermo >::R(), diffusionMulticomponent< ReactionThermo, ThermoType >::R(), reader::readField(), MRFZoneList::relative(), faMatrix< Type >::residual(), fvMatrix< Type >::residual(), LduMatrix< Type, DType, LUType >::residual(), lduMatrix::residual(), constantFilmThermo::rho(), phaseSystem::rho(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::rhoEff(), coalCloudList::rhoTrans(), fvDOM::Rp(), pyrolysisChemistryModel< CompType, SolidThermo, GasThermo >::RRg(), solidChemistryModel< CompType, SolidThermo >::RRs(), solidChemistryModel< CompType, SolidThermo >::RRsHs(), eddyDissipationDiffusionModel< ReactionThermo, ThermoType >::rtDiff(), fvDOM::Ru(), patchProbes::sample(), probes::sample(), mappedPatchBase::samplePoints(), coalCloudList::Sh(), ThermoCloud< Foam::DSMCCloud >::Sh(), thermoSingleLayer::Sh(), primaryRadiation::Shs(), standardRadiation::Shs(), constantRadiation::Shs(), liquidFilmThermo::sigma(), constantFilmThermo::sigma(), cloudScatter::sigmaEff(), ThermoCloud< Foam::DSMCCloud >::sigmap(), skewCorrected< Type >::skewCorrection(), cellQuality::skewness(), snGradScheme< Type >::snGrad(), twoPhaseSystem::solve(), surfaceAlignedSBRStressFvMotionSolver::solve(), thermalBaffle::solveEnergy(), sensitivityBezierFI::solveMeshMovementEqn(), optionList::source(), Foam::fam::Sp(), noiseModel::SPL(), Foam::sqr(), coalCloudList::Srho(), ReactingCloud< Foam::DSMCCloud >::Srho(), thermoSingleLayer::Srho(), Foam::stabilise(), regionFunctionObject::store(), Foam::fam::Su(), coalCloudList::SU(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::SU(), surfaceNormalFixedValueFvPatchVectorField::surfaceNormalFixedValueFvPatchVectorField(), multiphaseSystem::surfaceTension(), Foam::fam::SuSp(), multiphaseSystem::Svm(), coalCloudList::SYi(), ReactingCloud< Foam::DSMCCloud >::SYi(), thermoSingleLayer::T(), boundaryAdjointContributionIncompressible::tangentVelocitySource(), StandardChemistryModel< ReactionThermo, ThermoType >::tc(), heThermo< BasicSolidThermo, MixtureType >::THE(), temperatureDependentContactAngleForce::theta(), distributionContactAngleForce::theta(), perturbedTemperatureDependentContactAngleForce::theta(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::theta(), boundaryAdjointContributionIncompressible::TMVariable1(), boundaryAdjointContributionIncompressible::TMVariable2(), cyclicFaPatch::transfer(), Foam::transform(), sixDoFRigidBodyMotion::transform(), rigidBodyMotion::transformPoints(), Foam::transformPoints(), polynomial::Tsat(), function1::Tsat(), optimisationType::update(), inverseDistance::update(), adjointFarFieldVelocityFvPatchVectorField::updateCoeffs(), adjointWallVelocityLowReFvPatchVectorField::updateCoeffs(), adjointOutletPressureFvPatchScalarField::updateCoeffs(), adjointFarFieldPressureFvPatchScalarField::updateCoeffs(), lumpedMassWallTemperatureFvPatchScalarField::updateCoeffs(), surfaceNormalFixedValueFvPatchVectorField::updateCoeffs(), uniformNormalFixedValueFvPatchVectorField::updateCoeffs(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), turbulentTemperatureRadCoupledMixedFvPatchScalarField::updateCoeffs(), laminar::Us(), coalCloudList::UTrans(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::vDotSweep(), boundaryAdjointContributionIncompressible::velocitySource(), MassTransferPhaseSystem< BasePhaseSystem >::volTransfer(), boundaryAdjointContributionIncompressible::wallDistance(), midPoint< Type >::weights(), outletStabilised< Type >::weights(), faNVDscheme< Type, NVDweight >::weights(), limitedSurfaceInterpolationScheme< Type >::weights(), triSurfaceTools::writeCurvature(), Foam::edgeMeshTools::writeFeatureProximity(), Foam::ensightOutput::writeVolField(), general::x(), general::y(), alphatPhaseChangeJayatillekeWallFunctionFvPatchScalarField::yPlusTherm(), MRFZoneList::zeroFilter(), and wallLubricationModel::zeroGradWalls().