FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Pair< Type > Class Template Reference

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

#include <OpenFOAM/Pair.H>


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 52 of file Pair.H.

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)

Constructor & Destructor Documentation

Pair (  ) [inline]

Null constructor.

Definition at line 62 of file Pair.H.

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

Construct from components.

Definition at line 66 of file Pair.H.

Pair ( Istream &   is  ) [inline]

Construct from Istream.

Definition at line 73 of file Pair.H.


Member Function Documentation

const Type& first (  ) const [inline]
Type& first (  ) [inline]

Return first.

Definition at line 88 of file Pair.H.

const Type& second (  ) const [inline]
Type& second (  ) [inline]

Return second.

Definition at line 100 of file Pair.H.

Pair<Type> reversePair (  ) const [inline]

Return reverse pair.

Definition at line 106 of file Pair.H.

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

Return other.

Definition at line 112 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 141 of file Pair.H.


Friends And Related Function Documentation

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

Definition at line 160 of file Pair.H.

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

Definition at line 165 of file Pair.H.


The documentation for this class was generated from the following file:
  • src/OpenFOAM/primitives/Pair/Pair.H