All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
tmp< T > Class Template Reference

A class for managing temporary objects. More...

Inheritance diagram for tmp< T >:

Public Types

typedef T Type
 
typedef Foam::refCount refCount
 

Public Member Functions

 tmp (T *=0, bool nonReusable=false)
 Store object pointer of a non-reusable or reusable temporary object. More...
 
 tmp (const T &)
 Store object const reference. More...
 
 tmp (const tmp< T > &)
 Construct copy and increment reference count. More...
 
 tmp (const tmp< T > &&)
 Construct copy moving content, does not increment reference count. More...
 
 tmp (const tmp< T > &, bool allowTransfer)
 Construct copy transferring content of temporary if required. More...
 
 ~tmp ()
 Destructor: deletes temporary object when the reference count is 0. More...
 
bool isTmp () const
 Return true if this is really a temporary object. More...
 
bool empty () const
 Return true if this temporary object empty,. More...
 
bool valid () const
 Is this temporary object valid,. More...
 
word typeName () const
 Return the type name of the tmp. More...
 
Tref () const
 Return non-const reference or generate a fatal error. More...
 
Tptr () const
 Return tmp pointer for reuse. More...
 
void clear () const
 If object pointer points to valid object: More...
 
const Toperator() () const
 Const dereference operator. More...
 
 operator const T & () const
 Const cast to the underlying type reference. More...
 
Toperator-> ()
 Return object pointer. More...
 
const Toperator-> () const
 Return const object pointer. More...
 
void operator= (T *)
 Assignment to pointer changing this tmp to a temporary T. More...
 
void operator= (const tmp< T > &)
 Assignment transferring the temporary T to this tmp. More...
 
void operator= (const tmp< T > &&)
 Move assignment transferring the temporary T to this tmp. More...
 

Detailed Description

template<class T>
class Foam::tmp< T >

A class for managing temporary objects.

Source files
See also
Foam::refCount Foam::autoPtr

Definition at line 53 of file PtrList.H.

Member Typedef Documentation

◆ Type

typedef T Type

Definition at line 83 of file tmp.H.

◆ refCount

Definition at line 84 of file tmp.H.

Constructor & Destructor Documentation

◆ tmp() [1/5]

tmp ( T tPtr = 0,
bool  nonReusable = false 
)
inlineexplicit

Store object pointer of a non-reusable or reusable temporary object.

Definition at line 49 of file tmpI.H.

◆ tmp() [2/5]

tmp ( const T tRef)
inline

Store object const reference.

Definition at line 65 of file tmpI.H.

◆ tmp() [3/5]

tmp ( const tmp< T > &  t)
inline

Construct copy and increment reference count.

Definition at line 73 of file tmpI.H.

◆ tmp() [4/5]

tmp ( const tmp< T > &&  t)
inline

Construct copy moving content, does not increment reference count.

Definition at line 95 of file tmpI.H.

◆ tmp() [5/5]

tmp ( const tmp< T > &  t,
bool  allowTransfer 
)
inline

Construct copy transferring content of temporary if required.

Definition at line 108 of file tmpI.H.

◆ ~tmp()

~tmp ( )
inline

Destructor: deletes temporary object when the reference count is 0.

Definition at line 137 of file tmpI.H.

Member Function Documentation

◆ isTmp()

bool isTmp ( ) const
inline

Return true if this is really a temporary object.

Definition at line 153 of file tmpI.H.

Referenced by DispersionRASModel< CloudType >::cacheFields(), BrownianMotionForce< CloudType >::cacheFields(), Foam::constrainHbyA(), and Foam::constrainPhiHbyA().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inline

Return true if this temporary object empty,.

ie, a temporary without allocation

Definition at line 160 of file tmpI.H.

◆ valid()

bool valid ( ) const
inline

Is this temporary object valid,.

ie, it is a reference or a temporary that has been allocated

Definition at line 167 of file tmpI.H.

Referenced by basicSpecieMixture::basicSpecieMixture(), Foam::meshEdge(), and subCycleField< GeometricField >::~subCycleField().

Here is the caller graph for this function:

◆ typeName()

Foam::word typeName ( ) const
inline

Return the type name of the tmp.

constructed from the type name of T

Definition at line 174 of file tmpI.H.

◆ ref()

T & ref ( ) const
inline

Return non-const reference or generate a fatal error.

if the object is const.

Definition at line 181 of file tmpI.H.

Referenced by fvMatrix< Type >::A(), MRFZoneList::absolute(), greyMean::aCont(), wideBand::aCont(), interRegionHeatTransfer::addSup(), cloud::aDisp(), pairGAMGAgglomeration::agglomerate(), pairPatchAgglomeration::agglomerate(), GAMGInterface::agglomerateCoeffs(), MomentumCloud< Foam::DSMCCloud >::alpha(), waveAlphaFvPatchScalarField::alphan(), parcelCloudList::ap(), ThermoCloud< Foam::DSMCCloud >::ap(), Foam::atan2(), snappySnapDriver::avgCellCentres(), GeometricBoundaryField< vector, pointPatchField, pointMesh >::boundaryInternalField(), GeometricBoundaryField< vector, pointPatchField, pointMesh >::boundaryNeighbourField(), faceLimitedGrad< Type >::calcGrad(), faceMDLimitedGrad< Type >::calcGrad(), cellMDLimitedGrad< Type >::calcGrad(), curvatureSeparation::calcInvR1(), semiPermeableBaffleMassFractionFvPatchScalarField::calcPhiYp(), rotorDiskSource::calculate(), chemistryModel< ThermoType >::calculateRR(), nutkFilmWallFunctionFvPatchScalarField::calcUTau(), nutUSpaldingWallFunctionFvPatchScalarField::calcUTau(), primitiveMeshTools::cellDeterminant(), heThermo< BasicSolidThermo, MixtureType >::cellSetProperty(), MRFZoneList::centrifugalAcceleration(), Foam::checkMethod(), Foam::cmptAv(), Foam::cmptMag(), Foam::cmptMax(), Foam::cmptMin(), fvPatch::Cn(), FieldField< Foam::fvPatchField, scalar >::component(), Field< PointType >::component(), processorLduInterface::compressedReceive(), fvMeshStitcher::conformalNccBoundaryField(), fvMeshStitcher::conformalOrigBoundaryField(), kinematicSingleLayer::constrainFilmField(), Foam::constrainHbyA(), Foam::constrainPhiHbyA(), searchableBox::coordinates(), searchableSurfaceCollection::coordinates(), triSurfaceMesh::coordinates(), forceList::correct(), thermocapillaryForce::correct(), contactAngleForce::correct(), DeardorffDiffStress< BasicMomentumTransportModel >::correct(), LamBremhorstKE::correct(), ShihQuadraticKE::correct(), kOmega< BasicMomentumTransportModel >::correct(), LienLeschziner::correct(), kEpsilon< compressible::momentumTransportModel >::correct(), LaunderSharmaKE< BasicMomentumTransportModel >::correct(), kOmega2006< BasicMomentumTransportModel >::correct(), SpalartAllmaras< BasicMomentumTransportModel >::correct(), LienCubicKE::correct(), SpalartAllmarasDES< BasicMomentumTransportModel >::correct(), SSG< BasicMomentumTransportModel >::correct(), RNGkEpsilon< BasicMomentumTransportModel >::correct(), realizableKE< BasicMomentumTransportModel >::correct(), lambdaThixotropic< BasicMomentumTransportModel >::correct(), LRR< BasicMomentumTransportModel >::correct(), qZeta::correct(), kEpsilonLopesdaCosta< BasicMomentumTransportModel >::correct(), mixtureKEpsilon< BasicMomentumTransportModel >::correct(), v2f< BasicMomentumTransportModel >::correct(), kkLOmega::correct(), kOmegaSST< eddyViscosity< RASModel< BasicMomentumTransportModel > >, BasicMomentumTransportModel >::correct(), cubic< Type >::correction(), pointLinear< Type >::correction(), CentredFitSnGradScheme< Type, Polynomial, Stencil >::correction(), correctedSnGrad< Type >::correction(), faceCorrectedSnGrad< Type >::correction(), outletStabilised< Type >::correction(), basicSpecieMixture::correctMassFractions(), kOmegaSSTLM< BasicMomentumTransportModel >::correctReThetatGammaInt(), Foam::fvc::curl(), multiSolidBodyMotionSolver::curPoints(), solidBodyMotionSolver::curPoints(), velocityComponentLaplacianFvMotionSolver::curPoints(), interpolatingSolidBodyMotionSolver::curPoints(), displacementSBRStressFvMotionSolver::curPoints(), displacementComponentLaplacianFvMotionSolver::curPoints(), displacementLinearMotionMotionSolver::curPoints(), triSurface::curvature(), fvMatrix< Type >::D(), fvMatrix< Type >::DD(), cyclicAMIFvPatch::delta(), fvMesh::delta(), blackBodyEmission::deltaLambdaT(), nonlinearEddyViscosity< incompressible::RASModel >::devTau(), regionSizeDistribution::divide(), Fickian< unityLewisFourier< laminarThermophysicalTransportModel > >::divq(), nonUnityLewisEddyDiffusivity< TurbulenceThermophysicalTransportModel >::divq(), MaxwellStefan< unityLewisFourier< laminarThermophysicalTransportModel > >::divq(), blackBodyEmission::EbDeltaLambdaT(), wideBandCombustion::ECont(), greyMeanCombustion::ECont(), PatchTools::edgeNormals(), cloud::EDisp(), parcelCloudList::Ep(), ThermoCloud< Foam::DSMCCloud >::Ep(), atmBoundaryLayer::epsilon(), Foam::evaluate(), age::execute(), wallHeatTransferCoeff::execute(), scalarTransport::execute(), polyPatch::faceCellCentres(), primitiveMeshTools::faceConcavity(), lduMatrix::faceH(), PatchToPatchInterpolation< FromPatch, ToPatch >::faceInterpolate(), cellQuality::faceNonOrthogonality(), primitiveMeshTools::faceOrthogonality(), mappedPatchBase::facePoints(), polyMeshTools::faceSkewness(), primitiveMeshTools::faceSkewness(), cellQuality::faceSkewness(), PrimitivePatchInterpolation< Foam::PrimitivePatch >::faceToEdgeInterpolate(), PrimitivePatchInterpolation< Foam::PrimitivePatch >::faceToPointInterpolate(), fvMeshStitcher::fieldRMapSum(), surfaceFieldValue::filterField(), fvMatrix< Type >::flux(), fft::forwardTransform(), interfaceProperties::fraction(), correctedSnGrad< Type >::fullGradCorrection(), faceCorrectedSnGrad< Type >::fullGradCorrection(), EulerDdtScheme< Type >::fvcDdt(), CoEulerDdtScheme< Type >::fvcDdt(), SLTSDdtScheme< Type >::fvcDdt(), backwardDdtScheme< Type >::fvcDdt(), ddtScheme< Type >::fvcDdtPhiCoeff(), gaussConvectionScheme< Type >::fvcDiv(), gaussLaplacianScheme< Type, GType >::fvcLaplacian(), EulerD2dt2Scheme< Type >::fvmD2dt2(), EulerDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), SLTSDdtScheme< Type >::fvmDdt(), backwardDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), surfaceFieldValue::getFieldValues(), fvMeshStitcher::getOrigNccMagSfb(), lduMatrix::H(), fvMatrix< Type >::H(), lduMatrix::H1(), parcelCloudList::hsCoeff(), parcelCloudList::hsTrans(), ReynoldsAnalogy::htcByRhoCp(), kappaEff::htcByRhoCp(), FieldFunction1< Type, Sine< Type > >::integral(), GAMGInterface::interfaceInternalField(), cyclicAMIGAMGInterface::internalFieldTransfer(), cyclicGAMGInterface::internalFieldTransfer(), isoSurface::interpolate(), pointToPointPlanarInterpolation::interpolate(), PLICU::interpolate(), localMin< Type >::interpolate(), localMax< Type >::interpolate(), PLIC::interpolate(), vtkMesh::interpolate(), interfaceCompressionNew::interpolate(), surfaceInterpolationScheme< GType >::interpolate(), fvMeshSubset::interpolate(), fieldInterpolation< scalar, interpolationCellPoint< scalar > >::interpolate(), cyclicAMIPolyPatch::interpolate(), volPointInterpolation::interpolate(), plane::interpolateField(), isoSurface::interpolateField(), thresholdCellFaces::interpolateField(), patch::interpolateField(), triSurfaceMesh::interpolateField(), AMIInterpolation::interpolateToSource(), AMIInterpolation::interpolateToTarget(), volPointInterpolation::interpolateUnconstrained(), Foam::inv(), isoSurface::isoSurface(), MaxwellStefan< unityLewisFourier< laminarThermophysicalTransportModel > >::j(), ReynoldsStress< LESModel< BasicMomentumTransportModel > >::k(), SpalartAllmarasDES< BasicMomentumTransportModel >::k(), atmBoundaryLayer::k(), heSolidThermo< BasicSolidThermo, MixtureType >::Kappa(), Foam::levelSetFraction(), PhiScheme< Type, PhiLimiter >::limiter(), LimitedScheme< Type, Limiter, LimitFunc >::limiter(), Foam::mag(), Foam::magSqr(), Foam::fvc::magSqrGradGrad(), directFieldMapper::map(), distributedWeightedFvPatchFieldMapper::map(), generalFieldMapper::map(), timeVaryingMappedFvPatchField< Type >::map(), meshToMesh::mapSrcToTgt(), meshToMesh::mapTgtToSrc(), momentOfInertia::meshInertia(), Foam::min(), regionModel1D::moveMesh(), fvMesh::movePoints(), primitiveMesh::movePoints(), Foam::New(), fvMeshStitcher::nonConformalBoundaryField(), cellQuality::nonOrthogonality(), basicSpecieMixture::normalise(), strainRateFunction::nu(), nutkWallFunctionFvPatchScalarField::nut(), nutUWallFunctionFvPatchScalarField::nut(), nutURoughWallFunctionFvPatchScalarField::nut(), nutkAtmRoughWallFunctionFvPatchScalarField::nut(), nutkRoughWallFunctionFvPatchScalarField::nut(), consumptionSpeed::omega0Sigma(), inversePointDistanceDiffusivity::operator()(), anisotropicFilter::operator()(), RaviPetersen::operator()(), Foam::operator/(), heThermo< BasicSolidThermo, MixtureType >::patchFieldProperty(), fvPatch::patchInternalField(), AMIInterpolation::patchMagSf(), jumpCyclicFvPatchField< Type >::patchNeighbourField(), jumpCyclicAMIFvPatchField< Type >::patchNeighbourField(), cyclicAMIFvsPatchField< Type >::patchNeighbourField(), cyclicFvPatchField< Type >::patchNeighbourField(), cyclicAMIFvPatchField< Type >::patchNeighbourField(), kinematicSingleLayer::pe(), noiseFFT::Pf(), specieTransferTemperatureFvPatchScalarField::phiHep(), specieTransferVelocityFvPatchVectorField::phip(), sampledSurface::pointAverage(), PatchToPatchInterpolation< FromPatch, ToPatch >::pointInterpolate(), PatchTools::pointNormals(), boundBox::points(), searchablePlate::points(), searchableCylinder::points(), treeBoundBox::points(), searchableSurfaceCollection::points(), PrimitivePatchInterpolation< Foam::PrimitivePatch >::pointToFaceInterpolate(), projectCurveEdge::position(), projectEdge::position(), blockEdge::position(), Foam::pow(), sampledSurface::project(), Fickian< unityLewisFourier< laminarThermophysicalTransportModel > >::q(), nonUnityLewisEddyDiffusivity< TurbulenceThermophysicalTransportModel >::q(), MaxwellStefan< unityLewisFourier< laminarThermophysicalTransportModel > >::q(), chemistryModel< ThermoType >::Qdot(), laminar::R(), EDC::R(), mappedPatchBase::readListOrField(), processorLduInterface::receive(), Foam::fvc::reconstruct(), MRFZoneList::relative(), fvMatrix< Type >::residual(), LduMatrix< Type, DType, LUType >::residual(), lduMatrix::residual(), fft::reverseTransform(), MomentumCloud< Foam::DSMCCloud >::rhoEff(), fvDOM::Ru(), patchProbes::sample(), probes::sample(), triSurfaceMesh::sampleField(), patch::sampleField(), patchInternalField::sampleField(), sampledSets::sampleLocalType(), mappedPatchBase::samplePoints(), waveSuperposition::scale(), parcelCloudList::Sh(), thermoSingleLayer::Sh(), ThermoCloud< Foam::DSMCCloud >::Sh(), nonlinearEddyViscosity< incompressible::RASModel >::sigma(), temperatureDependent::sigma(), kinematicSingleLayer::sigma(), cloud::sigmaEff(), parcelCloudList::sigmap(), ThermoCloud< Foam::DSMCCloud >::sigmap(), skewCorrected< Type >::skewCorrection(), cellQuality::skewness(), snGradScheme< Type >::snGrad(), LLTMatrix< Type >::solve(), QRMatrix< MatrixType >::solve(), LUscalarMatrix::solve(), thermalBaffle::solveEnergy(), fvModels::source(), fvModel::source(), SlicedGeometricField< Type, PatchField, SlicedPatchField, GeoMesh >::splice(), Foam::sqr(), parcelCloudList::Srho(), ReactingCloud< Foam::DSMCCloud >::Srho(), kinematicSingleLayer::Srho(), Foam::stabilise(), regionFunctionObject::store(), parcelCloudList::SU(), MomentumCloud< Foam::DSMCCloud >::SU(), kinematicSingleLayer::SU(), MPLIC::surfaceAlpha(), parcelCloudList::SYi(), ReactingCloud< Foam::DSMCCloud >::SYi(), thermoSingleLayer::SYi(), fvMeshStitcher::synchronisedBoundaryField(), FieldField< Foam::fvPatchField, scalar >::T(), Field< PointType >::T(), DimensionedField< Type, Foam::pointMesh >::T(), GeometricField< vector, pointPatchField, pointMesh >::T(), chemistryModel< ThermoType >::tc(), temperatureDependentContactAngleForce::theta(), perturbedTemperatureDependentContactAngleForce::theta(), parcelCloudList::theta(), MomentumCloud< Foam::DSMCCloud >::theta(), targetCoeffTrim::thetag(), Foam::transform(), sixDoFRigidBodyMotion::transform(), Foam::transformFieldMask< tensor >(), porosityModel::transformModelData(), Foam::transformPoints(), EulerCoordinateRotation::transformVector(), STARCDCoordinateRotation::transformVector(), axesRotation::transformVector(), cylindrical::transformVector(), triSurface::triSurfInstance(), thermoSingleLayer::Tw(), SRFModel::Uabs(), parcelCloudList::UCoeff(), waveAtmBoundaryLayerSuperposition::UGas(), waveVelocityFvPatchVectorField::Un(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), parcelCloudList::UTrans(), kinematicSingleLayer::Uw(), FieldFunction2< Type, ZeroConstant< Type > >::value(), FieldFunction1< Type, Sine< Type > >::value(), MomentumCloud< Foam::DSMCCloud >::vDotSweep(), heThermo< BasicSolidThermo, MixtureType >::volScalarFieldProperty(), midPoint< Type >::weights(), reverseLinear< Type >::weights(), outletStabilised< Type >::weights(), clippedLinear< Type >::weights(), limitedSurfaceInterpolationScheme< scalar >::weights(), noiseFFT::window(), Table< scalar >::y(), nutUWallFunctionFvPatchScalarField::yPlus(), nutURoughWallFunctionFvPatchScalarField::yPlus(), MRFZoneList::zeroFilter(), Foam::zip(), DimensionedField< Type, Foam::pointMesh >::~DimensionedField(), FSD::~FSD(), Gulders::~Gulders(), and GuldersEGR::~GuldersEGR().

◆ ptr()

◆ clear()

void clear ( ) const
inline

If object pointer points to valid object:

delete object and set pointer to nullptr

Definition at line 237 of file tmpI.H.

Referenced by MRFZoneList::absolute(), lduMatrix::Amul(), boundBox::boundBox(), Foam::checkMethod(), kEqn< BasicMomentumTransportModel >::correct(), LamBremhorstKE::correct(), kOmega< BasicMomentumTransportModel >::correct(), dynamicKEqn< BasicMomentumTransportModel >::correct(), LienLeschziner::correct(), kEpsilon< compressible::momentumTransportModel >::correct(), LaunderSharmaKE< BasicMomentumTransportModel >::correct(), SpalartAllmarasDES< BasicMomentumTransportModel >::correct(), RNGkEpsilon< BasicMomentumTransportModel >::correct(), kEpsilonLopesdaCosta< BasicMomentumTransportModel >::correct(), mixtureKEpsilon< BasicMomentumTransportModel >::correct(), kOmegaSST< eddyViscosity< RASModel< BasicMomentumTransportModel > >, BasicMomentumTransportModel >::correct(), kOmegaSSTLM< BasicMomentumTransportModel >::correctReThetatGammaInt(), Foam::fvc::DDt(), Foam::fvm::div(), Foam::fvc::div(), Foam::fvc::flux(), fft::forwardTransform(), surfaceInterpolationScheme< GType >::interpolate(), Foam::inv(), Foam::min(), anisotropicFilter::operator()(), noiseFFT::Pf(), PatchToPatchInterpolation< FromPatch, ToPatch >::pointInterpolate(), Foam::pow(), realizableKE< BasicMomentumTransportModel >::rCmu(), Foam::fvc::reconstructMag(), MRFZoneList::relative(), fft::reverseTransform(), snGradScheme< Type >::snGrad(), Foam::stabilise(), lduMatrix::Tmul(), Foam::transform(), Foam::transformPoints(), and Foam::fvc::volumeIntegrate().

Here is the caller graph for this function:

◆ operator()()

const T & operator() ( ) const
inline

Const dereference operator.

Definition at line 279 of file tmpI.H.

Referenced by tmp< Foam::surfaceInterpolationScheme< GType > >::clear().

Here is the caller graph for this function:

◆ operator const T &()

operator const T & ( ) const
inline

Const cast to the underlying type reference.

Definition at line 297 of file tmpI.H.

◆ operator->() [1/2]

T * operator-> ( )
inline

Return object pointer.

Definition at line 304 of file tmpI.H.

◆ operator->() [2/2]

const T * operator-> ( ) const
inline

Return const object pointer.

Definition at line 327 of file tmpI.H.

◆ operator=() [1/3]

void operator= ( T tPtr)
inline

Assignment to pointer changing this tmp to a temporary T.

Definition at line 341 of file tmpI.H.

◆ operator=() [2/3]

void operator= ( const tmp< T > &  t)
inline

Assignment transferring the temporary T to this tmp.

Definition at line 366 of file tmpI.H.

◆ operator=() [3/3]

void operator= ( const tmp< T > &&  t)
inline

Move assignment transferring the temporary T to this tmp.

Definition at line 395 of file tmpI.H.


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