OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

Pair< Type > Class Template Reference

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

Inheritance diagram for Pair< Type >:
Collaboration diagram for Pair< Type >:

List of all members.


Public Member Functions

 Pair ()
 Null constructor.
 Pair (const Type &f, const Type &s)
 Construct from components.
 Pair (Istream &is)
 Construct from Istream.
const Type & first () const
 Return first.
Type & first ()
 Return first.
const Type & second () const
 Return second.
Type & second ()
 Return second.
Pair< Type > reversePair () const
 Return reverse pair.
const Type & other (const Type &a) const
 Return other.

Static Public Member Functions

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

Friends

bool operator== (const Pair< Type > &a, const Pair< Type > &b)
bool operator!= (const Pair< Type > &a, const Pair< Type > &b)

Detailed Description

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

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

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

Definition at line 44 of file Pair.H.


Constructor & Destructor Documentation

Pair (  )  [inline]

Null constructor.

Definition at line 54 of file Pair.H.

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

Construct from components.

Definition at line 58 of file Pair.H.

Pair ( Istream &  is  )  [inline]

Construct from Istream.

Definition at line 65 of file Pair.H.


Member Function Documentation

const Type& first (  )  const [inline]

Return first.

Definition at line 74 of file Pair.H.

Referenced by hash::operator()(), and Pair< word >::Pair().

Here is the caller graph for this function:

Type& first (  )  [inline]

Return first.

Definition at line 80 of file Pair.H.

const Type& second (  )  const [inline]

Return second.

Definition at line 86 of file Pair.H.

Referenced by hash::operator()(), and Pair< word >::Pair().

Here is the caller graph for this function:

Type& second (  )  [inline]

Return second.

Definition at line 92 of file Pair.H.

Pair<Type> reversePair (  )  const [inline]

Return reverse pair.

Definition at line 98 of file Pair.H.

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

Return other.

Definition at line 104 of file Pair.H.

static int compare ( const Pair< Type > &  a,
const Pair< Type > &  b 
) [inline, static]

compare Pairs

  • 0: different
  • +1: identical
  • -1: same pair, but reversed order

Definition at line 135 of file Pair.H.


Friends And Related Function Documentation

bool operator== ( const Pair< Type > &  a,
const Pair< Type > &  b 
) [friend]

Definition at line 154 of file Pair.H.

bool operator!= ( const Pair< Type > &  a,
const Pair< Type > &  b 
) [friend]

Definition at line 159 of file Pair.H.


The documentation for this class was generated from the following file:
  • src/OpenFOAM/primitives/Pair/Pair.H
Copyright © 2000-2009 OpenCFD Ltd