Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
OpenFOAM
meshes
polyMesh
mapPolyMesh
objectMap
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 | Copyright (C) 1991-2010 OpenCFD Ltd.
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
Description
25
26
\*---------------------------------------------------------------------------*/
27
28
#include <
OpenFOAM/IOstreams.H
>
29
30
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
31
32
namespace
Foam
33
{
34
35
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36
37
inline
objectMap::objectMap
()
38
:
39
index_(-1),
40
masterObjects_(0)
41
{}
42
43
44
inline
objectMap::objectMap
(
const
label index,
const
labelList
& master)
45
:
46
index_(index),
47
masterObjects_(master)
48
{}
49
50
51
inline
objectMap::objectMap
(
Istream
& is)
52
{
53
// Read beginning of objectMap
54
is.
readBegin
(
"objectMap"
);
55
56
is >> index_ >>
static_cast<
labelList
&
>
(masterObjects_);
57
58
// Read master of objectMap
59
is.
readEnd
(
"objectMap"
);
60
61
// Check state of Istream
62
is.
check
(
"objectMap::objectMap(Istream&)"
);
63
}
64
65
66
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
67
68
label&
objectMap::index
()
69
{
70
return
index_;
71
}
72
73
74
inline
label
objectMap::index
()
const
75
{
76
return
index_;
77
}
78
79
80
inline
labelList
&
objectMap::masterObjects
()
81
{
82
return
masterObjects_;
83
}
84
85
86
inline
const
labelList
&
objectMap::masterObjects
()
const
87
{
88
return
masterObjects_;
89
}
90
91
92
// * * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * //
93
94
inline
bool
operator==
(
const
objectMap
& a,
const
objectMap
&
b
)
95
{
96
return
97
(
98
(a.index_ == b.index_) && (a.masterObjects_ == b.masterObjects_)
99
);
100
}
101
102
103
inline
bool
operator!=
(
const
objectMap
& a,
const
objectMap
&
b
)
104
{
105
return
(!(a == b));
106
}
107
108
109
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
110
111
inline
Ostream
&
operator<<
(
Ostream
& os,
const
objectMap
& a)
112
{
113
os <<
token::BEGIN_LIST
114
<< a.index_ <<
token::SPACE
115
<< a.masterObjects_
116
<<
token::END_LIST
;
117
118
// Check state of Ostream
119
os.
check
(
"Ostream& operator<<(Ostream&, const objectMap&)"
);
120
121
return
os;
122
}
123
124
125
inline
Istream
&
operator>>
(
Istream
& is,
objectMap
& a)
126
{
127
is.
readBegin
(
"objectMap"
);
128
is >> a.index_ >> a.masterObjects_;
129
is.
readEnd
(
"objectMap"
);
130
131
// Check state of Istream
132
is.
check
(
"Istream& operator>>(Istream&, objectMap&)"
);
133
134
return
is;
135
}
136
137
138
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140
}
// Master namespace Foam
141
142
// ************************ vim: set sw=4 sts=4 et: ************************ //