IOdictionary.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) 2011-2016 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::IOdictionary
26 
27 Description
28  IOdictionary is derived from dictionary and IOobject to give the dictionary
29  automatic IO functionality via the objectRegistry. To facilitate IO,
30  IOdictioanry is provided with a constructor from IOobject and writeData and
31  write functions.
32 
33 SourceFiles
34  IOdictionary.C
35  IOdictionaryIO.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef IOdictionary_H
40 #define IOdictionary_H
41 
42 #include "dictionary.H"
43 #include "regIOobject.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class IOdictionary Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class IOdictionary
55 :
56  public regIOobject,
57  public dictionary
58 {
59  // Private data
60 
61  static bool writeDictionaries;
62 
63 
64  // Private Member Functions
65 
66  //- Read dictionary from file
67  // Parallel aware reading, using non-virtual type information
68  // (typeName instead of type()) because of use in constructor.
69  void readFile(const bool);
70 
71 
72 public:
73 
74  TypeName("dictionary");
75 
76 
77  // Constructors
78 
79  //- Construct given an IOobject
80  IOdictionary(const IOobject&);
81 
82  //- Construct given an IOobject and dictionary
83  IOdictionary(const IOobject&, const dictionary&);
84 
85  //- Construct given an IOobject and Istream
86  IOdictionary(const IOobject&, Istream&);
87 
88 
89  //- Destructor
90  virtual ~IOdictionary();
91 
92 
93  // Member functions
94 
95  //- Name function is needed to disambiguate those inherited
96  // from regIOobject and dictionary
97  const word& name() const;
98 
99  //- ReadData function required for regIOobject read operation
100  bool readData(Istream&);
101 
102  //- WriteData function required for regIOobject write operation
103  bool writeData(Ostream&) const;
104 
105 
106  // Member operators
107 
108  //- Assignment of other IOdictionary's entries to this IOdictionary
109  void operator=(const IOdictionary&);
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
void operator=(const IOdictionary &)
Assignment of other IOdictionary&#39;s entries to this IOdictionary.
Definition: IOdictionary.C:189
A class for handling words, derived from string.
Definition: word.H:59
virtual ~IOdictionary()
Destructor.
Definition: IOdictionary.C:175
const word & name() const
Name function is needed to disambiguate those inherited.
Definition: IOdictionary.C:181
bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
IOdictionary(const IOobject &)
Construct given an IOobject.
Definition: IOdictionary.C:45
bool readData(Istream &)
ReadData function required for regIOobject read operation.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:60
TypeName("dictionary")
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Namespace for OpenFOAM.