GlobalIOList.C
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) 2015-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 \*---------------------------------------------------------------------------*/
25 
26 #include "GlobalIOList.H"
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Type>
32 :
33  regIOobject(io)
34 {
35  // Check for MUST_READ_IF_MODIFIED
36  warnNoRereading<GlobalIOList<Type>>();
37 
38  readHeaderOk(IOstream::BINARY, typeName);
39 }
40 
41 
42 template<class Type>
44 :
45  regIOobject(io)
46 {
47  // Check for MUST_READ_IF_MODIFIED
48  warnNoRereading<GlobalIOList<Type>>();
49 
50  if (!readHeaderOk(IOstream::BINARY, typeName))
51  {
52  List<Type>::setSize(size);
53  }
54 }
55 
56 
57 template<class Type>
59 :
60  regIOobject(io)
61 {
62  // Check for MUST_READ_IF_MODIFIED
63  warnNoRereading<GlobalIOList<Type>>();
64 
65  if (!readHeaderOk(IOstream::BINARY, typeName))
66  {
68  }
69 }
70 
71 
72 template<class Type>
74 (
75  const IOobject& io,
76  List<Type>&& f
77 )
78 :
79  regIOobject(io),
80  List<Type>(move(f))
81 
82 {
83  // Check for MUST_READ_IF_MODIFIED
84  warnNoRereading<GlobalIOList<Type>>();
85 
86  readHeaderOk(IOstream::BINARY, typeName);
87 }
88 
89 
90 template<class Type>
92 (
93  const GlobalIOList<Type>& field
94 )
95 :
96  regIOobject(field),
98 {}
99 
100 
101 template<class Type>
103 (
104  GlobalIOList<Type>&& field
105 )
106 :
107  regIOobject(move(field)),
108  List<Type>(move(field))
109 {}
110 
111 
112 // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
113 
114 template<class Type>
116 {}
117 
118 
119 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
120 
121 template<class Type>
123 {
124  is >> *this;
125  return is.good();
126 }
127 
128 
129 template<class Type>
131 {
132  return (os << *this).good();
133 }
134 
135 
136 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
137 
138 template<class Type>
140 {
142 }
143 
144 
145 template<class Type>
147 {
148  List<Type>::operator=(move(rhs));
149 }
150 
151 
152 template<class Type>
154 {
156 }
157 
158 
159 template<class Type>
161 {
162  List<Type>::operator=(move(rhs));
163 }
164 
165 
166 // ************************************************************************* //
bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
Definition: GlobalIOList.C:130
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
Definition: GlobalIOList.C:122
bool good() const
Return true if next operation might succeed.
Definition: IOstream.H:330
points setSize(newPointi)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual ~GlobalIOList()
Destructor.
Definition: GlobalIOList.C:115
IOList with global data (so optionally read from master)
Definition: GlobalIOList.H:50
labelList f(nPoints)
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:52
GlobalIOList(const IOobject &)
Construct from IOobject.
Definition: GlobalIOList.C:31
rDeltaTY field()
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:98
void operator=(const GlobalIOList< Type > &)
Definition: GlobalIOList.C:139