phasePairKey.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2014-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::phasePairKey
26 
27 Description
28 
29 SourceFiles
30 
31 \*---------------------------------------------------------------------------*/
32 
33 #ifndef phasePairKey_H
34 #define phasePairKey_H
35 
36 #include "Pair.H"
37 
38 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39 
40 namespace Foam
41 {
42 
43 // Forward declaration of friend functions and operators
44 
45 class phasePairKey;
46 
47 bool operator==(const phasePairKey&, const phasePairKey&);
48 bool operator!=(const phasePairKey&, const phasePairKey&);
49 
50 Istream& operator>>(Istream&, phasePairKey&);
51 Ostream& operator<<(Ostream&, const phasePairKey&);
52 
53 
54 /*---------------------------------------------------------------------------*\
55  Class phasePairKey Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class phasePairKey
59 :
60  public Pair<word>
61 {
62 public:
63 
64  class hash
65  :
66  public Hash<phasePairKey>
67  {
68  public:
69 
70  // Constructors
71 
72  // Construct null
73  hash();
74 
75 
76  // Member operators
77 
78  // Generate a hash from a phase pair key
79  label operator()(const phasePairKey& key) const;
80  };
81 
82 
83 private:
84 
85  // Private data
86 
87  //- Flag to indicate whether ordering is important
88  bool ordered_;
89 
90 
91 public:
92 
93  // Constructors
94 
95  //- Construct null
96  phasePairKey();
97 
98  //- Construct from names and the ordering flag
99  phasePairKey(const word& name1, const word& name2, const bool ordered);
100 
101 
102  // Destructor
103  virtual ~phasePairKey();
104 
105 
106  // Friend Operators
107 
108  //- Test if keys are equal
109  friend bool operator==(const phasePairKey& a, const phasePairKey& b);
110 
111  //- Test if keys are unequal
112  friend bool operator!=(const phasePairKey& a, const phasePairKey& b);
113 
114  //- Read from stdin
115  friend Istream& operator>>(Istream& is, phasePairKey& key);
116 
117  //- Write to stdout
118  friend Ostream& operator<<(Ostream& os, const phasePairKey& key);
119 };
120 
121 
122 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123 
124 } // End namespace Foam
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 #endif
129 
130 // ************************************************************************* //
bool ordered() const
Return the ordered flag.
label operator()(const phasePairKey &key) const
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
friend Ostream & operator<<(Ostream &os, const phasePairKey &key)
Write to stdout.
friend bool operator!=(const phasePairKey &a, const phasePairKey &b)
Test if keys are unequal.
friend bool operator==(const phasePairKey &a, const phasePairKey &b)
Test if keys are equal.
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Istream & operator>>(Istream &, directionInfo &)
virtual ~phasePairKey()
Ostream & operator<<(Ostream &, const ensightPart &)
phasePairKey()
Construct null.
bool operator!=(const particle &, const particle &)
Definition: particle.C:1150
Namespace for OpenFOAM.
friend Istream & operator>>(Istream &is, phasePairKey &key)
Read from stdin.