A class for managing temporary objects. More...
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... | |
T & | ref () const |
Return non-const reference or generate a fatal error. More... | |
T * | ptr () const |
Return tmp pointer for reuse. More... | |
void | clear () const |
If object pointer points to valid object: More... | |
const T & | operator() () const |
Const dereference operator. More... | |
operator const T & () const | |
Const cast to the underlying type reference. More... | |
T * | operator-> () |
Return object pointer. More... | |
const T * | operator-> () 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 transfering the temporary T to this tmp. More... | |
A class for managing temporary objects.
typedef Foam::refCount refCount |
Store object pointer.
Definition at line 49 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, and tmp< T >::typeName().
Construct copy and increment reference count.
Definition at line 73 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), and tmp< T >::typeName().
Construct copy moving content, does not increment reference count.
Definition at line 95 of file tmpI.H.
References tmp< T >::isTmp().
Construct copy transferring content of temporary if required.
Definition at line 108 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), and tmp< T >::typeName().
|
inline |
Destructor: deletes temporary object when the reference count is 0.
Definition at line 137 of file tmpI.H.
References tmp< T >::clear().
|
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(), tmp< T >::clear(), Foam::constrainHbyA(), tmp< T >::empty(), tmp< T >::operator()(), Xfer< T >::operator->(), tmp< T >::operator->(), tmp< T >::operator=(), tmp< T >::ptr(), tmp< T >::ref(), tmp< T >::tmp(), and tmp< T >::valid().
|
inline |
Return true if this temporary object empty,.
ie, a temporary without allocation
Definition at line 153 of file tmpI.H.
References tmp< T >::isTmp().
|
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.
References tmp< T >::isTmp().
|
inline |
Return the type name of the tmp.
constructed from the type name of T
Definition at line 167 of file tmpI.H.
References Foam::name(), and Foam::T().
Referenced by tmp< T >::clear(), tmp< T >::operator()(), tmp< T >::operator->(), tmp< T >::operator=(), tmp< T >::ptr(), tmp< T >::ref(), and tmp< T >::tmp().
|
inline |
Return non-const reference or generate a fatal error.
if the object is const.
Definition at line 174 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), and tmp< T >::typeName().
Referenced by fvMatrix< Type >::A(), MRFZoneList::absolute(), greyMeanAbsorptionEmission::aCont(), wideBandAbsorptionEmission::aCont(), isoSurface::adaptPatchFields(), cloudAbsorptionEmission::aDisp(), pairGAMGAgglomeration::agglomerate(), pairPatchAgglomeration::agglomerate(), GAMGInterface::agglomerateCoeffs(), KinematicCloud< CloudType >::alpha(), heThermo< BasicThermo, MixtureType >::alphaEff(), ThermoCloud< CloudType >::ap(), Foam::atan2(), Foam::fvc::average(), snappySnapDriver::avgCellCentres(), faceLimitedGrad< Type >::calcGrad(), faceMDLimitedGrad< Type >::calcGrad(), cellMDLimitedGrad< Type >::calcGrad(), cellLimitedGrad< Type >::calcGrad(), curvatureSeparation::calcInvR1(), nutkWallFunctionFvPatchScalarField::calcNut(), nutUWallFunctionFvPatchScalarField::calcNut(), nutkRoughWallFunctionFvPatchScalarField::calcNut(), nutkAtmRoughWallFunctionFvPatchScalarField::calcNut(), chemistryModel< CompType, ThermoType >::calculateRR(), nutUTabulatedWallFunctionFvPatchScalarField::calcUPlus(), nutkFilmWallFunctionFvPatchScalarField::calcUTau(), nutUSpaldingWallFunctionFvPatchScalarField::calcUTau(), nutUWallFunctionFvPatchScalarField::calcYPlus(), primitiveMeshTools::cellDeterminant(), Foam::checkMethod(), Foam::cmptAv(), Foam::cmptMag(), Foam::cmptMax(), Foam::cmptMin(), fvPatch::Cn(), FieldField< Field, Type >::component(), Field< Type >::component(), processorLduInterface::compressedReceive(), Foam::constrainHbyA(), searchableBox::coordinates(), searchableSurfaceCollection::coordinates(), triSurfaceMesh::coordinates(), forceList::correct(), thermocapillaryForce::correct(), contactAngleForce::correct(), DeardorffDiffStress< BasicTurbulenceModel >::correct(), radiativeIntensityRay::correct(), kEqn< BasicTurbulenceModel >::correct(), LamBremhorstKE::correct(), ShihQuadraticKE::correct(), LienLeschziner::correct(), dynamicKEqn< BasicTurbulenceModel >::correct(), LienCubicKE::correct(), SSG< BasicTurbulenceModel >::correct(), SpalartAllmaras< BasicTurbulenceModel >::correct(), kOmega< BasicTurbulenceModel >::correct(), kEpsilon< BasicTurbulenceModel >::correct(), LaunderSharmaKE< BasicTurbulenceModel >::correct(), realizableKE< BasicTurbulenceModel >::correct(), RNGkEpsilon< BasicTurbulenceModel >::correct(), SpalartAllmarasDES< BasicTurbulenceModel >::correct(), LRR< BasicTurbulenceModel >::correct(), qZeta::correct(), mixtureKEpsilon< BasicTurbulenceModel >::correct(), v2f< BasicTurbulenceModel >::correct(), kkLOmega::correct(), kOmegaSST< TurbulenceModel, BasicTurbulenceModel >::correct(), cubic< Type >::correction(), CentredFitSnGradScheme< Type, Polynomial, Stencil >::correction(), pointLinear< Type >::correction(), correctedSnGrad< Type >::correction(), faceCorrectedSnGrad< Type >::correction(), outletStabilised< Type >::correction(), liquidFilmThermo::Cp(), heThermo< BasicThermo, MixtureType >::Cp(), constantFilmThermo::Cp(), heThermo< BasicThermo, MixtureType >::CpByCpv(), heThermo< BasicThermo, MixtureType >::Cpv(), Foam::fvc::curl(), velocityComponentLaplacianFvMotionSolver::curPoints(), displacementSBRStressFvMotionSolver::curPoints(), displacementComponentLaplacianFvMotionSolver::curPoints(), displacementInterpolationMotionSolver::curPoints(), heThermo< BasicThermo, MixtureType >::Cv(), fvMatrix< Type >::D(), fvMatrix< Type >::DD(), cyclicFvPatch::delta(), cyclicAMIFvPatch::delta(), cyclicACMIFvPatch::delta(), fvMesh::delta(), nonlinearEddyViscosity< BasicTurbulenceModel >::devRhoReff(), singleStepCombustion< CombThermoType, ThermoType >::dQ(), laminar< Type >::dQ(), solidChemistryModel< CompType, SolidThermo >::dQ(), chemistryModel< CompType, ThermoType >::dQ(), SpalartAllmarasDES< BasicTurbulenceModel >::dTilda(), blackBodyEmission::EbDeltaLambdaT(), greyMeanAbsorptionEmission::ECont(), wideBandAbsorptionEmission::ECont(), PatchTools::edgeNormals(), cloudAbsorptionEmission::EDisp(), ThermoCloud< CloudType >::Ep(), polyPatch::faceCellCentres(), primitiveMeshTools::faceConcavity(), lduMatrix::faceH(), PatchToPatchInterpolation< FromPatch, ToPatch >::faceInterpolate(), cellQuality::faceNonOrthogonality(), primitiveMeshTools::faceOrthogonality(), mappedPatchBase::facePoints(), polyMeshTools::faceSkewness(), primitiveMeshTools::faceSkewness(), cellQuality::faceSkewness(), PrimitivePatchInterpolation< Patch >::faceToEdgeInterpolate(), PrimitivePatchInterpolation< Patch >::faceToPointInterpolate(), surfaceRegion::filterField(), volPointInterpolation::flatBoundaryField(), fvMatrix< Type >::flux(), fft::forwardTransform(), correctedSnGrad< Type >::fullGradCorrection(), faceCorrectedSnGrad< Type >::fullGradCorrection(), EulerDdtScheme< Type >::fvcDdt(), backwardDdtScheme< Type >::fvcDdt(), CoEulerDdtScheme< Type >::fvcDdt(), SLTSDdtScheme< Type >::fvcDdt(), localEulerDdtScheme< Type >::fvcDdt(), ddtScheme< Type >::fvcDdtPhiCoeff(), gaussConvectionScheme< Type >::fvcDiv(), gaussLaplacianScheme< Type, GType >::fvcLaplacian(), EulerD2dt2Scheme< Type >::fvmD2dt2(), EulerDdtScheme< Type >::fvmDdt(), backwardDdtScheme< Type >::fvmDdt(), CoEulerDdtScheme< Type >::fvmDdt(), SLTSDdtScheme< Type >::fvmDdt(), localEulerDdtScheme< Type >::fvmDdt(), gaussConvectionScheme< Type >::fvmDiv(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), gaussLaplacianScheme< Type, GType >::fvmLaplacianUncorrected(), heThermo< BasicThermo, MixtureType >::gamma(), pyrolysisChemistryModel< CompType, SolidThermo, GasThermo >::gasHs(), surfaceRegion::getFieldValues(), cylindricalCS::globalToLocal(), kinematicSingleLayer::gNormClipped(), lduMatrix::H(), fvMatrix< Type >::H(), lduMatrix::H1(), heThermo< BasicThermo, MixtureType >::hc(), heThermo< BasicThermo, MixtureType >::he(), heheuPsiThermo< BasicPsiThermo, MixtureType >::heu(), coalCloudList::hsTrans(), Function1< Type >::integrate(), GAMGInterface::interfaceInternalField(), cyclicACMIGAMGInterface::internalFieldTransfer(), cyclicAMIGAMGInterface::internalFieldTransfer(), cyclicGAMGInterface::internalFieldTransfer(), pointToPointPlanarInterpolation::interpolate(), localMax< Type >::interpolate(), localMin< Type >::interpolate(), surfaceInterpolationScheme< Type >::interpolate(), vtkMesh::interpolate(), fvMeshSubset::interpolate(), volPointInterpolation::interpolate(), isoSurface::interpolate(), sampledPlane::interpolateField(), sampledIsoSurfaceCell::interpolateField(), sampledThresholdCellFaces::interpolateField(), sampledPatch::interpolateField(), sampledTriSurfaceMesh::interpolateField(), AMIInterpolation< SourcePatch, TargetPatch >::interpolateToSource(), AMIInterpolation< SourcePatch, TargetPatch >::interpolateToTarget(), Foam::inv(), ReynoldsStress< BasicTurbulenceModel >::k(), heSolidThermo< BasicSolidThermo, MixtureType >::Kappa(), liquidFilmThermo::kappa(), constantFilmThermo::kappa(), heThermo< BasicThermo, MixtureType >::kappa(), heThermo< BasicThermo, MixtureType >::kappaEff(), 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< Enum, nEnum >::names(), Foam::New(), fvPatchField< Type >::New(), cellQuality::nonOrthogonality(), chemistryModel< CompType, ThermoType >::omega(), consumptionSpeed::omega0Sigma(), optionList::operator()(), ListPlusEqOp< T, Size >::operator()(), anisotropicFilter::operator()(), RaviPetersen::operator()(), Foam::operator/(), fvPatch::patchInternalField(), jumpCyclicFvPatchField< Type >::patchNeighbourField(), cyclicFvPatchField< Type >::patchNeighbourField(), cyclicAMIFvPatchField< Type >::patchNeighbourField(), cyclicACMIFvPatchField< Type >::patchNeighbourField(), noiseFFT::Pf(), sampledSurface::pointAverage(), PatchToPatchInterpolation< FromPatch, ToPatch >::pointInterpolate(), PatchTools::pointNormals(), searchablePlate::points(), boundBox::points(), searchableCylinder::points(), searchableSurfaceCollection::points(), treeBoundBox::points(), PrimitivePatchInterpolation< Patch >::pointToFaceInterpolate(), Foam::pow(), sampledSurface::project(), heheuPsiThermo< BasicPsiThermo, MixtureType >::psib(), heheuPsiThermo< BasicPsiThermo, MixtureType >::psiu(), nonlinearEddyViscosity< BasicTurbulenceModel >::R(), laminar< Type >::R(), SpalartAllmarasDES< BasicTurbulenceModel >::r(), mappedPatchBase::readListOrField(), processorLduInterface::receive(), MRFZoneList::relative(), fvMatrix< Type >::residual(), LduMatrix< Type, DType, LUType >::residual(), lduMatrix::residual(), fft::reverseTransform(), liquidFilmThermo::rho(), constantFilmThermo::rho(), KinematicCloud< CloudType >::rhoEff(), coalCloudList::rhoTrans(), pyrolysisChemistryModel< CompType, SolidThermo, GasThermo >::RRg(), solidChemistryModel< CompType, SolidThermo >::RRs(), patchProbes::sample(), probes::sample(), sampledTriSurfaceMesh::sampleField(), sampledPatch::sampleField(), sampledPatchInternalField::sampleField(), mappedPatchBase::samplePoints(), coalCloudList::Sh(), laminar< Type >::Sh(), solidChemistryModel< CompType, SolidThermo >::Sh(), chemistryModel< CompType, ThermoType >::Sh(), ThermoCloud< CloudType >::Sh(), primaryRadiation::Shs(), standardRadiation::Shs(), constantRadiation::Shs(), liquidFilmThermo::sigma(), constantFilmThermo::sigma(), cloudScatter::sigmaEff(), ThermoCloud< CloudType >::sigmap(), skewCorrected< Type >::skewCorrection(), cellQuality::skewness(), snGradScheme< Type >::snGrad(), LLTMatrix< Type >::solve(), QRMatrix< MatrixType >::solve(), LUscalarMatrix::solve(), thermalBaffle::solveEnergy(), Foam::sqr(), coalCloudList::Srho(), ReactingCloud< CloudType >::Srho(), thermoSingleLayer::Srho(), Foam::stabilise(), regionFunctionObject::store(), coalCloudList::SU(), KinematicCloud< CloudType >::SU(), coalCloudList::SYi(), ReactingCloud< CloudType >::SYi(), FieldField< Field, Type >::T(), thermoSingleLayer::T(), Field< Type >::T(), GeometricField< Type, PatchField, GeoMesh >::T(), chemistryModel< CompType, ThermoType >::tc(), heThermo< BasicThermo, MixtureType >::THE(), thermalBaffle1DFvPatchScalarField< solidType >::thermalBaffle1DFvPatchScalarField(), KinematicCloud< CloudType >::theta(), targetCoeffTrim::thetag(), Foam::transform(), sixDoFRigidBodyMotion::transform(), Foam::transformFieldMask< tensor >(), porosityModel::transformModelData(), Foam::transformPoints(), rigidBodyMotion::transformPoints(), STARCDCoordinateRotation::transformVector(), EulerCoordinateRotation::transformVector(), axesRotation::transformVector(), cylindrical::transformVector(), turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs(), laminar::Us(), coalCloudList::UTrans(), Function1< Type >::value(), KinematicCloud< CloudType >::vDotSweep(), basicSpecieMixture::W(), midPoint< Type >::weights(), outletStabilised< Type >::weights(), limitedSurfaceInterpolationScheme< Type >::weights(), noiseFFT::window(), rotorDiskSource::writeField(), TableBase< Type >::y(), FSD< CombThermoType, ThermoType >::~FSD(), greyMeanSolidAbsorptionEmission::~greyMeanSolidAbsorptionEmission(), Gulders::~Gulders(), and GuldersEGR::~GuldersEGR().
|
inline |
Return tmp pointer for reuse.
Returns a clone if the object is not a temporary
Definition at line 198 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), Foam::T(), and tmp< T >::typeName().
Referenced by DispersionRASModel< CloudType >::cacheFields(), BrownianMotionForce< CloudType >::cacheFields(), Foam::checkMethod(), gaussLaplacianScheme< Type, GType >::fvmLaplacian(), volPointInterpolation::interpolate(), FieldField< Field, Type >::operator=(), PtrListDictionary< T >::set(), regionFunctionObject::store(), and gradScheme< Type >::~gradScheme().
|
inline |
If object pointer points to valid object:
delete object and set pointer to NULL
Definition at line 230 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), tmp< T >::operator()(), Foam::T(), and tmp< T >::typeName().
Referenced by MRFZoneList::absolute(), lduMatrix::Amul(), boundBox::boundBox(), Implicit< CloudType >::cacheFields(), Foam::checkMethod(), kEqn< BasicTurbulenceModel >::correct(), LamBremhorstKE::correct(), LienLeschziner::correct(), dynamicKEqn< BasicTurbulenceModel >::correct(), kEpsilon< BasicTurbulenceModel >::correct(), kOmega< BasicTurbulenceModel >::correct(), LaunderSharmaKE< BasicTurbulenceModel >::correct(), RNGkEpsilon< BasicTurbulenceModel >::correct(), mixtureKEpsilon< BasicTurbulenceModel >::correct(), kOmegaSST< TurbulenceModel, BasicTurbulenceModel >::correct(), Foam::fvc::DDt(), Foam::fvm::div(), Foam::fvc::div(), Foam::fvc::flux(), fft::forwardTransform(), surfaceInterpolationScheme< Type >::interpolate(), Foam::inv(), anisotropicFilter::operator()(), tmp< T >::operator=(), noiseFFT::Pf(), PatchToPatchInterpolation< FromPatch, ToPatch >::pointInterpolate(), Foam::pow(), realizableKE< BasicTurbulenceModel >::rCmu(), Foam::fvc::reconstructMag(), MRFZoneList::relative(), fft::reverseTransform(), snGradScheme< Type >::snGrad(), Foam::stabilise(), lduMatrix::Tmul(), Foam::transform(), Foam::transformPoints(), Foam::fvc::volumeIntegrate(), and tmp< T >::~tmp().
|
inline |
Const dereference operator.
Definition at line 272 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), and tmp< T >::typeName().
Referenced by tmp< T >::clear(), and tmp< T >::operator const T &().
|
inline |
Const cast to the underlying type reference.
Definition at line 290 of file tmpI.H.
References tmp< T >::operator()().
|
inline |
Return object pointer.
Definition at line 297 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), and tmp< T >::typeName().
|
inline |
Return const object pointer.
Definition at line 320 of file tmpI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), and tmp< T >::typeName().
|
inline |
Assignment to pointer changing this tmp to a temporary T.
Definition at line 334 of file tmpI.H.
References Foam::abort(), tmp< T >::clear(), Foam::FatalError, FatalErrorInFunction, and tmp< T >::typeName().
Assignment transfering the temporary T to this tmp.
Definition at line 359 of file tmpI.H.
References Foam::abort(), tmp< T >::clear(), Foam::FatalError, FatalErrorInFunction, tmp< T >::isTmp(), Foam::name(), Foam::T(), and tmp< T >::typeName().