All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
objectMap.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) 2011-2019 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::objectMap
26 
27 Description
28  An objectMap is a pair of labels defining the mapping of an object from
29  another object, e.g. a cell mapped from a point.
30 
31 SourceFiles
32  objectMapI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef objectMap_H
37 #define objectMap_H
38 
39 #include "labelList.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 
48 class objectMap;
49 inline bool operator==(const objectMap& a, const objectMap& b);
50 inline bool operator!=(const objectMap& a, const objectMap& b);
51 inline Ostream& operator<<(Ostream&, const objectMap&);
52 inline Istream& operator>>(Istream&, objectMap&);
53 
54 
55 /*---------------------------------------------------------------------------*\
56  Class objectMap Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class objectMap
60 {
61  // Private Data
62 
63  //- Object index
64  label index_;
65 
66  //- Master object index
67  labelList masterObjects_;
68 
69 
70 public:
71 
72  // Constructors
73 
74  //- Null constructor for lists
75  inline objectMap();
76 
77  //- Construct from components
78  inline objectMap(const label index, const labelList& master);
79 
80  //- Construct from Istream
81  inline objectMap(Istream&);
82 
83 
84  // Member Functions
85 
86  //- Return object index
87  inline label& index();
88  inline label index() const;
89 
90  //- Return master object index
91  inline labelList& masterObjects();
92  inline const labelList& masterObjects() const;
93 
94 
95  // Friend Operators
96 
97  friend bool operator==(const objectMap& a, const objectMap& b);
98  friend bool operator!=(const objectMap& a, const objectMap& b);
99 
100 
101  // IOstream Operators
102 
103  friend Ostream& operator<<(Ostream&, const objectMap&);
104 
105  friend Istream& operator>>(Istream&, objectMap&);
106 };
107 
108 
109 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 
111 } // End namespace Foam
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 #include "objectMapI.H"
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
friend bool operator!=(const objectMap &a, const objectMap &b)
Definition: objectMapI.H:103
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
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
friend Ostream & operator<<(Ostream &, const objectMap &)
Definition: objectMapI.H:111
An objectMap is a pair of labels defining the mapping of an object from another object, e.g. a cell mapped from a point.
Definition: objectMap.H:58
objectMap()
Null constructor for lists.
Definition: objectMapI.H:37
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 &)
friend Istream & operator>>(Istream &, objectMap &)
Definition: objectMapI.H:125
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
labelList & masterObjects()
Return master object index.
Definition: objectMapI.H:80
Ostream & operator<<(Ostream &, const ensightPart &)
friend bool operator==(const objectMap &a, const objectMap &b)
Definition: objectMapI.H:94
bool operator!=(const particle &, const particle &)
Definition: particle.C:1204
label & index()
Return object index.
Definition: objectMapI.H:68
Namespace for OpenFOAM.