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 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  void readFile(const bool);
68 
69 
70 public:
71 
72  TypeName("dictionary");
73 
74 
75  // Constructors
76 
77  //- Construct given an IOobject
78  IOdictionary(const IOobject&);
79 
80  //- Construct given an IOobject and dictionary
81  IOdictionary(const IOobject&, const dictionary&);
82 
83  //- Construct given an IOobject and Istream
84  IOdictionary(const IOobject&, Istream&);
85 
86 
87  //- Destructor
88  virtual ~IOdictionary();
89 
90 
91  // Member functions
92 
93  //- Name function is needed to disambiguate those inherited
94  // from regIOobject and dictionary
95  const word& name() const;
96 
97  //- ReadData function required for regIOobject read operation
98  bool readData(Istream&);
99 
100  //- WriteData function required for regIOobject write operation
101  bool writeData(Ostream&) const;
102 
103 
104  // Member operators
105 
106  //- Assignment of other IOdictionary's entries to this IOdictionary
107  void operator=(const IOdictionary&);
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
regIOobject.H
Foam::IOdictionary::operator=
void operator=(const IOdictionary &)
Assignment of other IOdictionary's entries to this IOdictionary.
Definition: IOdictionary.C:189
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::IOdictionary::IOdictionary
IOdictionary(const IOobject &)
Construct given an IOobject.
Definition: IOdictionary.C:45
Foam::IOdictionary::~IOdictionary
virtual ~IOdictionary()
Destructor.
Definition: IOdictionary.C:175
Foam::IOdictionary::writeData
bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
Definition: IOdictionaryIO.C:157
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
Foam::IOdictionary::readData
bool readData(Istream &)
ReadData function required for regIOobject read operation.
Definition: IOdictionaryIO.C:139
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::IOdictionary::readFile
void readFile(const bool)
Read dictionary from file.
Definition: IOdictionaryIO.C:33
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::IOdictionary::TypeName
TypeName("dictionary")
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:60
Foam::IOdictionary::name
const word & name() const
Name function is needed to disambiguate those inherited.
Definition: IOdictionary.C:181
Foam::IOdictionary::writeDictionaries
static bool writeDictionaries
Definition: IOdictionary.H:60
dictionary.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53