Public Types | Public Member Functions | List of all members
tmp< T > Class Template Reference

A class for managing temporary objects. More...

Inheritance diagram for tmp< T >:
Inheritance graph
[legend]

Public Types

typedef T Type
 
typedef Foam::refCount refCount
 

Public Member Functions

 tmp (T *=0)
 Store object pointer. 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...
 

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 79 of file tmp.H.

◆ refCount

Definition at line 80 of file tmp.H.

Constructor & Destructor Documentation

◆ tmp() [1/5]

tmp ( T tPtr = 0)
inlineexplicit

Store object pointer.

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 146 of file tmpI.H.

Referenced by DispersionRASModel< CloudType >::cacheFields(), BrownianMotionForce< CloudType >::cacheFields(), Foam::constrainHbyA(), Xfer< T >::operator->(), and tmp< Foam::surfaceInterpolationScheme< GType > >::operator=().

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 153 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 160 of file tmpI.H.

Referenced by basicMultiComponentMixture::basicMultiComponentMixture().

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 167 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 174 of file tmpI.H.

Referenced by fvMatrix< Type >::A(), MRFZoneList::absolute(), greyMeanAbsorptionEmission::aCont(), wideBandAbsorptionEmission::aCont(), isoSurface::adaptPatchFields(), cloudAbsorptionEmission::aDisp(), pairGAMGAgglomeration::agglomerate(), pairPatchAgglomeration::agglomerate(), GAMGInterface::agglomerateCoeffs(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::alpha(), heThermo< BasicSolidThermo, MixtureType >::alphaEff(), heThermo< BasicSolidThermo, MixtureType >::alphahe(), waveAlphaFvPatchScalarField::alphan(), ThermoCloud< Foam::DSMCCloud >::ap(), Foam::atan2(), snappySnapDriver::avgCellCentres(), subtract::calcFieldType(), add::calcFieldType(), faceLimitedGrad< Type >::calcGrad(), faceMDLimitedGrad< Type >::calcGrad(), cellMDLimitedGrad< Type >::calcGrad(), wallHeatTransferCoeff::calcHeatTransferCoeff(), curvatureSeparation::calcInvR1(), nutkWallFunctionFvPatchScalarField::calcNut(), nutUWallFunctionFvPatchScalarField::calcNut(), nutkRoughWallFunctionFvPatchScalarField::calcNut(), nutkAtmRoughWallFunctionFvPatchScalarField::calcNut(), wallShearStress::calcShearStress(), StandardChemistryModel< CompType, ThermoType >::calculateRR(), nutUTabulatedWallFunctionFvPatchScalarField::calcUPlus(), nutkFilmWallFunctionFvPatchScalarField::calcUTau(), nutUSpaldingWallFunctionFvPatchScalarField::calcUTau(), wallHeatFlux::calcWallHeatFlux(), nutUWallFunctionFvPatchScalarField::calcYPlus(), primitiveMeshTools::cellDeterminant(), Foam::checkMethod(), Foam::cmptAv(), Foam::cmptMag(), Foam::cmptMax(), Foam::cmptMin(), fvPatch::Cn(), FieldField< Foam::Field, LUType >::component(), Field< Foam::Vector2D >::component(), processorLduInterface::compressedReceive(), Foam::constrainHbyA(), searchableBox::coordinates(), searchableSurfaceCollection::coordinates(), triSurfaceMesh::coordinates(), forceList::correct(), thermocapillaryForce::correct(), contactAngleForce::correct(), DeardorffDiffStress< BasicTurbulenceModel >::correct(), Maxwell< BasicTurbulenceModel >::correct(), kEqn< BasicTurbulenceModel >::correct(), LamBremhorstKE::correct(), ShihQuadraticKE::correct(), LienLeschziner::correct(), dynamicKEqn< BasicTurbulenceModel >::correct(), LienCubicKE::correct(), SSG< BasicTurbulenceModel >::correct(), SpalartAllmaras< BasicTurbulenceModel >::correct(), kEpsilon< EddyDiffusivity< compressible::turbulenceModel > >::correct(), kOmega< BasicTurbulenceModel >::correct(), realizableKE< BasicTurbulenceModel >::correct(), LaunderSharmaKE< BasicTurbulenceModel >::correct(), RNGkEpsilon< BasicTurbulenceModel >::correct(), SpalartAllmarasDES< BasicTurbulenceModel >::correct(), LRR< BasicTurbulenceModel >::correct(), qZeta::correct(), kEpsilonLopesdaCosta< BasicTurbulenceModel >::correct(), mixtureKEpsilon< BasicTurbulenceModel >::correct(), v2f< BasicTurbulenceModel >::correct(), kkLOmega::correct(), kOmegaSST< LESeddyViscosity< BasicTurbulenceModel >, BasicTurbulenceModel >::correct(), cubic< Type >::correction(), pointLinear< Type >::correction(), CentredFitSnGradScheme< Type, Polynomial, Stencil >::correction(), correctedSnGrad< Type >::correction(), faceCorrectedSnGrad< Type >::correction(), outletStabilised< Type >::correction(), kOmegaSSTLM< BasicTurbulenceModel >::correctReThetatGammaInt(), liquidFilmThermo::Cp(), constantFilmThermo::Cp(), heThermo< BasicSolidThermo, MixtureType >::Cp(), heThermo< BasicSolidThermo, MixtureType >::CpByCpv(), heThermo< BasicSolidThermo, MixtureType >::Cpv(), Foam::fvc::curl(), multiSolidBodyMotionSolver::curPoints(), solidBodyMotionSolver::curPoints(), velocityComponentLaplacianFvMotionSolver::curPoints(), displacementComponentLaplacianFvMotionSolver::curPoints(), displacementSBRStressFvMotionSolver::curPoints(), displacementInterpolationMotionSolver::curPoints(), displacementLinearMotionMotionSolver::curPoints(), triSurface::curvature(), heThermo< BasicSolidThermo, MixtureType >::Cv(), fvMatrix< Type >::D(), fvMatrix< Type >::DD(), cyclicFvPatch::delta(), cyclicAMIFvPatch::delta(), fvMesh::delta(), blackBodyEmission::deltaLambdaT(), nonlinearEddyViscosity< incompressible::RASModel >::devRhoReff(), SpalartAllmarasDES< BasicTurbulenceModel >::dTilda(), blackBodyEmission::EbDeltaLambdaT(), greyMeanAbsorptionEmission::ECont(), wideBandAbsorptionEmission::ECont(), PatchTools::edgeNormals(), cloudAbsorptionEmission::EDisp(), ThermoCloud< Foam::DSMCCloud >::Ep(), 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(), surfaceFieldValue::filterField(), volPointInterpolation::flatBoundaryField(), fvMatrix< Type >::flux(), fft::forwardTransform(), 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(), heThermo< BasicSolidThermo, MixtureType >::gamma(), pyrolysisChemistryModel< CompType, SolidThermo, GasThermo >::gasHs(), surfaceFieldValue::getFieldValues(), cylindricalCS::globalToLocal(), kinematicSingleLayer::gNormClipped(), lduMatrix::H(), fvMatrix< Type >::H(), lduMatrix::H1(), heThermo< BasicSolidThermo, MixtureType >::hc(), heThermo< BasicSolidThermo, MixtureType >::he(), heheuPsiThermo< BasicPsiThermo, MixtureType >::heu(), coalCloudList::hsTrans(), FieldFunction1< Function1Type >::integrate(), GAMGInterface::interfaceInternalField(), cyclicAMIGAMGInterface::internalFieldTransfer(), cyclicGAMGInterface::internalFieldTransfer(), pointToPointPlanarInterpolation::interpolate(), localMax< Type >::interpolate(), localMin< Type >::interpolate(), surfaceInterpolationScheme< GType >::interpolate(), vtkMesh::interpolate(), fvMeshSubset::interpolate(), volPointInterpolation::interpolate(), cyclicAMIPolyPatch::interpolate(), isoSurface::interpolate(), sampledPlane::interpolateField(), sampledIsoSurfaceCell::interpolateField(), sampledThresholdCellFaces::interpolateField(), sampledPatch::interpolateField(), sampledTriSurfaceMesh::interpolateField(), AMIInterpolation< SourcePatch, TargetPatch >::interpolateToSource(), AMIInterpolation< SourcePatch, TargetPatch >::interpolateToTarget(), Foam::inv(), ReynoldsStress< RASModel< BasicTurbulenceModel > >::k(), heSolidThermo< BasicSolidThermo, MixtureType >::Kappa(), liquidFilmThermo::kappa(), constantFilmThermo::kappa(), heThermo< BasicSolidThermo, MixtureType >::kappa(), heThermo< BasicSolidThermo, MixtureType >::kappaEff(), Foam::levelSetFraction(), Foam::mag(), Foam::magSqr(), Foam::fvc::magSqrGradGrad(), meshToMesh::mapSrcToTgt(), meshToMesh::mapTgtToSrc(), momentOfInertia::meshInertia(), regionModel1D::moveMesh(), fvMesh::movePoints(), primitiveMesh::movePoints(), liquidFilmThermo::mu(), constantFilmThermo::mu(), heheuPsiThermo< BasicPsiThermo, MixtureType >::mub(), heheuPsiThermo< BasicPsiThermo, MixtureType >::muu(), NamedEnum< directionType, 3 >::names(), Foam::New(), fvPatchField< Type >::New(), cellQuality::nonOrthogonality(), consumptionSpeed::omega0Sigma(), ListPlusEqOp< T, Size >::operator()(), anisotropicFilter::operator()(), RaviPetersen::operator()(), Foam::operator/(), fvPatch::patchInternalField(), AMIInterpolation< SourcePatch, TargetPatch >::patchMagSf(), jumpCyclicFvPatchField< Type >::patchNeighbourField(), cyclicFvPatchField< Type >::patchNeighbourField(), cyclicAMIFvPatchField< Type >::patchNeighbourField(), noiseFFT::Pf(), wavePressureFvPatchScalarField::pn(), sampledSurface::pointAverage(), PatchToPatchInterpolation< FromPatch, ToPatch >::pointInterpolate(), PatchTools::pointNormals(), searchablePlate::points(), boundBox::points(), searchableCylinder::points(), searchableSurfaceCollection::points(), treeBoundBox::points(), PrimitivePatchInterpolation< Foam::PrimitivePatch >::pointToFaceInterpolate(), projectEdge::position(), projectCurveEdge::position(), blockEdge::position(), Foam::pow(), sampledSurface::project(), heheuPsiThermo< BasicPsiThermo, MixtureType >::psib(), heheuPsiThermo< BasicPsiThermo, MixtureType >::psiu(), laminar< ReactionThermo >::Qdot(), EDC< ReactionThermo >::Qdot(), solidChemistryModel< CompType, SolidThermo >::Qdot(), StandardChemistryModel< CompType, ThermoType >::Qdot(), nonlinearEddyViscosity< incompressible::RASModel >::R(), laminar< ReactionThermo >::R(), SpalartAllmarasDES< BasicTurbulenceModel >::r(), mappedPatchBase::readListOrField(), processorLduInterface::receive(), Foam::fvc::reconstruct(), MRFZoneList::relative(), fvMatrix< Type >::residual(), LduMatrix< Type, DType, LUType >::residual(), lduMatrix::residual(), fft::reverseTransform(), liquidFilmThermo::rho(), constantFilmThermo::rho(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::rhoEff(), coalCloudList::rhoTrans(), fvDOM::Rp(), pyrolysisChemistryModel< CompType, SolidThermo, GasThermo >::RRg(), solidChemistryModel< CompType, SolidThermo >::RRs(), fvDOM::Ru(), patchProbes::sample(), probes::sample(), sampledPatch::sampleField(), sampledTriSurfaceMesh::sampleField(), sampledPatchInternalField::sampleField(), 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(), LLTMatrix< Type >::solve(), QRMatrix< MatrixType >::solve(), LUscalarMatrix::solve(), thermalBaffle::solveEnergy(), optionList::source(), Foam::sqr(), coalCloudList::Srho(), ReactingCloud< Foam::DSMCCloud >::Srho(), thermoSingleLayer::Srho(), Foam::stabilise(), regionFunctionObject::store(), coalCloudList::SU(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::SU(), coalCloudList::SYi(), ReactingCloud< Foam::DSMCCloud >::SYi(), FieldField< Foam::Field, LUType >::T(), thermoSingleLayer::T(), Field< Foam::Vector2D >::T(), GeometricField< vector, pointPatchField, pointMesh >::T(), StandardChemistryModel< CompType, ThermoType >::tc(), heThermo< BasicSolidThermo, MixtureType >::THE(), thermalBaffle1DFvPatchScalarField< solidType >::thermalBaffle1DFvPatchScalarField(), distributionContactAngleForce::theta(), temperatureDependentContactAngleForce::theta(), perturbedTemperatureDependentContactAngleForce::theta(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::theta(), targetCoeffTrim::thetag(), Foam::transform(), sixDoFRigidBodyMotion::transform(), Foam::transformFieldMask< tensor >(), porosityModel::transformModelData(), Foam::transformPoints(), rigidBodyMotion::transformPoints(), STARCDCoordinateRotation::transformVector(), EulerCoordinateRotation::transformVector(), axesRotation::transformVector(), cylindrical::transformVector(), triSurface::triSurfInstance(), waveVelocityFvPatchVectorField::Un(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), laminar::Us(), coalCloudList::UTrans(), FieldFunction1< Function1Type >::value(), KinematicCloud< Cloud< basicKinematicCollidingParcel > >::vDotSweep(), midPoint< Type >::weights(), outletStabilised< Type >::weights(), limitedSurfaceInterpolationScheme< Type >::weights(), noiseFFT::window(), rotorDiskSource::writeField(), TableBase< Type >::y(), MRFZoneList::zeroFilter(), Foam::zip(), FSD< ReactionThermo, ThermoType >::~FSD(), greyMeanSolidAbsorptionEmission::~greyMeanSolidAbsorptionEmission(), Gulders::~Gulders(), and GuldersEGR::~GuldersEGR().

◆ ptr()

T * ptr ( ) const
inline

◆ clear()

void clear ( ) const
inline

◆ operator()()

const T & operator() ( ) const
inline

Const dereference operator.

Definition at line 272 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 290 of file tmpI.H.

◆ operator->() [1/2]

T * operator-> ( )
inline

Return object pointer.

Definition at line 297 of file tmpI.H.

◆ operator->() [2/2]

const T * operator-> ( ) const
inline

Return const object pointer.

Definition at line 320 of file tmpI.H.

◆ operator=() [1/2]

void operator= ( T tPtr)
inline

Assignment to pointer changing this tmp to a temporary T.

Definition at line 334 of file tmpI.H.

◆ operator=() [2/2]

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

Assignment transferring the temporary T to this tmp.

Definition at line 359 of file tmpI.H.


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