1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
32 Foam::IOMap<T>::IOMap(const IOobject& io)
38 io.readOpt() == IOobject::MUST_READ
39 || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
42 readStream(typeName) >> *this;
48 Foam::IOMap<T>::IOMap(const IOobject& io, const label size)
54 io.readOpt() == IOobject::MUST_READ
55 || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
58 readStream(typeName) >> *this;
63 Map<T>::setSize(size);
69 Foam::IOMap<T>::IOMap(const IOobject& io, const Map<T>& map)
75 io.readOpt() == IOobject::MUST_READ
76 || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
79 readStream(typeName) >> *this;
84 Map<T>::operator=(map);
90 Foam::IOMap<T>::IOMap(const IOobject& io, const Xfer<Map<T> >& map)
94 Map<T>::transfer(map());
98 io.readOpt() == IOobject::MUST_READ
99 || (io.readOpt() == IOobject::READ_IF_PRESENT && headerOk())
102 readStream(typeName) >> *this;
108 // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
111 Foam::IOMap<T>::~IOMap()
115 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
118 bool Foam::IOMap<T>::writeData(Ostream& os) const
120 return (os << *this).good();
124 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
127 void Foam::IOMap<T>::operator=(const IOMap<T>& rhs)
129 Map<T>::operator=(rhs);
134 void Foam::IOMap<T>::operator=(const Map<T>& rhs)
136 Map<T>::operator=(rhs);
140 // ************************************************************************* //