Pair< Type > Class Template Reference

An ordered pair of two objects of type <Type> with first() and second() elements. More...

Inheritance diagram for Pair< Type >:

Classes

class  Hash
 Hashing function class. More...
 

Public Types

typedef Type value_type
 Type of values the pair contains. More...
 
typedef Type & reference
 Type that can be used for storing into. More...
 
typedef const Type & const_reference
 Type that can be used for storing into. More...
 

Public Member Functions

 Pair ()
 Null constructor. More...
 
 Pair (const Type &f, const Type &s)
 Construct from components. More...
 
 Pair (Istream &is)
 Construct from Istream. More...
 
const Type & first () const
 Return first. More...
 
Type & first ()
 Return first. More...
 
const Type & second () const
 Return second. More...
 
Type & second ()
 Return second. More...
 
const Type & other (const Type &a) const
 Return other. More...
 
Type & operator[] (const label i)
 Access an element by index. More...
 
const Type & operator[] (const label i) const
 Const-access an element by index. More...
 

Static Public Member Functions

static const Pair< Type > & null ()
 Return a null pair. More...
 
static label size ()
 Return the size. More...
 
static void checkIndex (const label i)
 Check index i is within valid range (0 ... 1) More...
 
static int compare (const Pair< Type > &a, const Pair< Type > &b)
 Compare two pairs. Return 0 if they are different, +1 if they are. More...
 

Detailed Description

template<class Type>
class Foam::Pair< Type >

An ordered pair of two objects of type <Type> with first() and second() elements.

See also
Foam::Tuple2 for storing two objects of dissimilar types.

Definition at line 65 of file Pair.H.

Member Typedef Documentation

◆ value_type

typedef Type value_type

Type of values the pair contains.

Definition at line 161 of file Pair.H.

◆ reference

typedef Type& reference

Type that can be used for storing into.

pair::value_type objects

Definition at line 165 of file Pair.H.

◆ const_reference

typedef const Type& const_reference

Type that can be used for storing into.

constant pair::value_type objects

Definition at line 169 of file Pair.H.

Constructor & Destructor Documentation

◆ Pair() [1/3]

Pair
inline

Null constructor.

Definition at line 79 of file PairI.H.

◆ Pair() [2/3]

Pair ( const Type &  f,
const Type &  s 
)
inline

Construct from components.

Definition at line 84 of file PairI.H.

◆ Pair() [3/3]

Pair ( Istream is)
inline

Construct from Istream.

Definition at line 92 of file PairI.H.

Member Function Documentation

◆ null()

const Foam::Pair< Type > & null
inlinestatic

Return a null pair.

Definition at line 33 of file PairI.H.

◆ size()

Foam::label size
inlinestatic

Return the size.

Definition at line 40 of file PairI.H.

◆ checkIndex()

void checkIndex ( const label  i)
inlinestatic

Check index i is within valid range (0 ... 1)

Definition at line 47 of file PairI.H.

References Foam::abort(), Foam::FatalError, and FatalErrorInFunction.

Here is the call graph for this function:

◆ compare()

int compare ( const Pair< Type > &  a,
const Pair< Type > &  b 
)
inlinestatic

Compare two pairs. Return 0 if they are different, +1 if they are.

identical, and -1 if the elements are the same but reversed.

Definition at line 59 of file PairI.H.

References b, and Foam::reverse().

Referenced by phaseInterface::New(), and Foam::operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ first() [1/2]

const Type & first
inline

Return first.

Definition at line 107 of file PairI.H.

Referenced by coefficientPhaseChange::addSup(), globalIndexAndTransform::addToTransformIndex(), preserveBafflesConstraint::apply(), meshRefinement::balance(), points::calcSamples(), lineFace::calcSamples(), Foam::cutPoly::cellCuts(), massDiffusionLimitedPhaseChange::correct(), decompositionMethod::decompose(), snappySnapDriver::doSnap(), populationBalanceModel::eta(), populationBalanceModel::etaV(), populationBalanceModel::expansionSu(), FvFaceCellWave< Type, TrackingData >::faceChanged(), FvFaceCellWave< Type, TrackingData >::faceInfo(), Foam::faceNij(), FvFaceCellWave< Type, TrackingData >::faceToCell(), InjectionModel< CloudType >::findCellAtPosition(), Foam::triIntersect::generateGeometry(), globalIndexAndTransform::globalIndexAndTransform(), heatTransferSystem::heatTransfer(), heatTransferSystem::Hs(), globalIndexAndTransform::index(), massTransfer::index(), irregular::irregular(), Foam::kShellIntegration(), phaseChange::L(), noiseFFT::Ldelta(), noiseFFT::Lf(), heatTransferLimitedPhaseChange::Lfraction(), massDiffusionLimitedPhaseChange::Lfraction(), reactionDrivenPhaseChange::mDot(), coefficientPhaseChange::mDot(), populationBalanceModel::modelSourceSu(), CollidingParcel< ParcelType >::move(), Distribution< Type >::normalised(), multiphaseVoFMixture::interfacePair::hash::operator()(), Foam::operator<(), Foam::operator==(), particle::patchData(), noiseFFT::Pdelta(), Distribution< Type >::raw(), Foam::readConfigFile(), phaseChange::setSpecies(), massTransfer::sign(), growthSecondaryPropertyFvScalarFieldSource::sourceCoeff(), growthSizeGroupFvScalarFieldSource::sourceCoeff(), growthSecondaryPropertyFvScalarFieldSource::sourceCoeffs(), growthSizeGroupFvScalarFieldSource::sourceCoeffs(), Foam::tracking::toStationaryTri(), globalIndexAndTransform::transformIndicesForPatches(), UniformTable< Type >::UniformTable(), patchToPatch::update(), meshPhiCorrectInfo::updateCell(), FvWallInfo< WallLocation >::updateFace(), sweepData::updateFace(), meshPhiCorrectInfo::updateFace(), and Distribution< Type >::validLimits().

Here is the caller graph for this function:

◆ first() [2/2]

Type & first
inline

Return first.

Definition at line 114 of file PairI.H.

◆ second() [1/2]

const Type & second
inline

Return second.

Definition at line 121 of file PairI.H.

Referenced by globalIndexAndTransform::addToTransformIndex(), preserveBafflesConstraint::apply(), meshRefinement::balance(), points::calcSamples(), lineFace::calcSamples(), Foam::cutPoly::cellCuts(), homogeneousCondensation::correct(), homogeneousLiquidPhaseSeparation::correct(), massDiffusionLimitedPhaseChange::correct(), decompositionMethod::decompose(), snappySnapDriver::doSnap(), populationBalanceModel::eta(), populationBalanceModel::etaV(), populationBalanceModel::expansionSu(), FvFaceCellWave< Type, TrackingData >::faceChanged(), FvFaceCellWave< Type, TrackingData >::faceInfo(), Foam::faceNij(), FvFaceCellWave< Type, TrackingData >::faceToCell(), InjectionModel< CloudType >::findCellAtPosition(), Foam::triIntersect::generateGeometry(), heatTransferSystem::heatTransfer(), heatTransferSystem::Hs(), massTransfer::index(), irregular::irregular(), Foam::kShellIntegration(), phaseChange::L(), noiseFFT::Ldelta(), noiseFFT::Lf(), heatTransferLimitedPhaseChange::Lfraction(), massDiffusionLimitedPhaseChange::Lfraction(), noiseFFT::Lsum(), reactionDrivenPhaseChange::mDot(), populationBalanceModel::modelSourceSu(), CollidingParcel< ParcelType >::move(), Distribution< Type >::normalised(), multiphaseVoFMixture::interfacePair::hash::operator()(), Foam::operator<(), Foam::operator==(), particle::patchData(), noiseFFT::Pdelta(), globalIndexAndTransform::processor(), Distribution< Type >::raw(), Foam::readConfigFile(), phaseChange::setSpecies(), massTransfer::sign(), growthSecondaryPropertyFvScalarFieldSource::sourceCoeff(), growthSizeGroupFvScalarFieldSource::sourceCoeff(), growthSecondaryPropertyFvScalarFieldSource::sourceCoeffs(), growthSizeGroupFvScalarFieldSource::sourceCoeffs(), Foam::tracking::toStationaryTri(), globalIndexAndTransform::transformIndex(), globalIndexAndTransform::transformIndicesForPatches(), UniformTable< Type >::UniformTable(), patchToPatch::update(), meshPhiCorrectInfo::updateCell(), FvWallInfo< WallLocation >::updateFace(), sweepData::updateFace(), meshPhiCorrectInfo::updateFace(), and Distribution< Type >::validLimits().

Here is the caller graph for this function:

◆ second() [2/2]

Type & second
inline

Return second.

Definition at line 128 of file PairI.H.

◆ other()

const Type & other ( const Type &  a) const
inline

Return other.

Definition at line 135 of file PairI.H.

◆ operator[]() [1/2]

Type & operator[] ( const label  i)
inline

Access an element by index.

Definition at line 164 of file PairI.H.

◆ operator[]() [2/2]

const Type & operator[] ( const label  i) const
inline

Const-access an element by index.

Definition at line 174 of file PairI.H.


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