Loading...
Searching...
No Matches
objectMapI.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26\*---------------------------------------------------------------------------*/
27
28#include "IOstreams.H"
29
30// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
31
32inline Foam::objectMap::objectMap(const label index, const labelUList& master)
33:
34 index_(index),
35 objects_(master)
36{}
37
38
39inline Foam::objectMap::objectMap(const label index, labelList&& master)
40:
41 index_(index),
42 objects_(std::move(master))
43{}
44
45
47{
48 is.readBegin("objectMap");
49
50 is >> index_ >> objects_;
51
52 is.readEnd("objectMap");
54}
55
56
57// * * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * //
58
59inline bool Foam::operator==(const objectMap& a, const objectMap& b)
60{
61 return
62 (
63 (a.index_ == b.index_) && (a.objects_ == b.objects_)
64 );
65}
66
67
68inline bool Foam::operator!=(const objectMap& a, const objectMap& b)
70 return !(a == b);
71}
72
73
74// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
75
76inline Foam::Ostream& Foam::operator<<(Ostream& os, const objectMap& a)
77{
79 << a.index_ << token::SPACE
80 << a.objects_
82
83 os.check(FUNCTION_NAME);
84 return os;
85}
86
87
88inline Foam::Istream& Foam::operator>>(Istream& is, objectMap& a)
89{
90 is.readBegin("objectMap");
91 is >> a.index_ >> a.objects_;
92 is.readEnd("objectMap");
93
94 is.check(FUNCTION_NAME);
95 return is;
96}
97
98
99// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition IOstream.C:45
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
bool readEnd(const char *funcName)
End read of data chunk, ends with ')'.
Definition Istream.C:152
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
Definition Istream.C:134
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
An objectMap is a pair of labels defining the mapping of an object from another object,...
Definition objectMap.H:57
objectMap() noexcept
Default construct, with index=-1 and no objects.
Definition objectMap.H:78
label & index() noexcept
The object index.
Definition objectMap.H:111
@ BEGIN_LIST
Begin list [isseparator].
Definition token.H:174
@ END_LIST
End list [isseparator].
Definition token.H:175
@ SPACE
Space [isspace].
Definition token.H:144
OBJstream os(runTime.globalPath()/outputName)
#define FUNCTION_NAME
bool operator!=(const eddy &a, const eddy &b)
Definition eddy.H:297
List< label > labelList
A List of labels.
Definition List.H:62
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Istream & operator>>(Istream &, directionInfo &)
UList< label > labelUList
A UList of labels.
Definition UList.H:75
volScalarField & b