specieElement.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) 2016-2020 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::specieElement
26 
27 Description
28 
29 SourceFiles
30  specieElementI.H
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef specieElement_H
35 #define specieElement_H
36 
37 #include "word.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 // Forward declaration of friend functions and operators
45 class specieElement;
46 Ostream& operator<<(Ostream&, const specieElement&);
47 
48 
49 /*---------------------------------------------------------------------------*\
50  Class specieElement Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class specieElement
54 {
55  // Private Data
56 
57  //- Name of the element
58  word name_;
59 
60  //- Number of atoms of this element in the specie
61  label nAtoms_;
62 
63 
64 public:
65 
66  // Constructors
67 
68  //- Construct null
69  inline specieElement();
70 
71  //- Construct from components
72  inline specieElement(const word& name, const label nAtoms);
73 
74  //- Construct from Istream
75  inline specieElement(Istream&);
76 
77 
78  // Member Functions
79 
80  //- Return the name of the element
81  inline const word& name() const;
82 
83  //- Return non-const access to the name of the element
84  inline word& name();
85 
86  //- Return the number of atoms of this element in the specie
87  inline label nAtoms() const;
88 
89  //- Return non-const access to the number of atoms of this element
90  // in the specie
91  inline label& nAtoms();
92 
93 
94  // Member Operators
95 
96  //- Equality comparison
97  inline bool operator==(const specieElement&) const;
98 
99  //- Inequality comparison
100  inline bool operator!=(const specieElement&) const;
101 
102 
103  // IOstream Operators
104 
105  inline friend Ostream& operator<<(Ostream&, const specieElement&);
106 };
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #include "specieElementI.H"
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
bool operator!=(const specieElement &) const
Inequality comparison.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
specieElement()
Construct null.
bool operator==(const specieElement &) const
Equality comparison.
A class for handling words, derived from string.
Definition: word.H:59
const word & name() const
Return the name of the element.
label nAtoms() const
Return the number of atoms of this element in the specie.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
friend Ostream & operator<<(Ostream &, const specieElement &)
Ostream & operator<<(Ostream &, const ensightPart &)
Namespace for OpenFOAM.