baseIOdictionary.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-2017 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::baseIOdictionary
26 
27 Description
28  baseIOdictionary is derived from dictionary and IOobject to give the
29  dictionary automatic IO functionality via the objectRegistry.
30  To facilitate IO,
31  IOdictionary is provided with a constructor from IOobject and writeData and
32  write functions.
33 
34 SourceFiles
35  baseIOdictionary.C
36  baseIOdictionaryIO.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef baseIOdictionary_H
41 #define baseIOdictionary_H
42 
43 #include "dictionary.H"
44 #include "regIOobject.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 /*---------------------------------------------------------------------------*\
52  Class baseIOdictionary Declaration
53 \*---------------------------------------------------------------------------*/
54 
55 class baseIOdictionary
56 :
57  public regIOobject,
58  public dictionary
59 {
60  // Private data
61 
62  static bool writeDictionaries;
63 
64 public:
65 
66  TypeName("dictionary");
67 
68 
69  // Constructors
70 
71  //- Construct given an IOobject
72  baseIOdictionary(const IOobject&);
73 
74  //- Construct given an IOobject and dictionary
75  baseIOdictionary(const IOobject&, const dictionary&);
76 
77  //- Construct given an IOobject and Istream
79 
80 
81  //- Destructor
82  virtual ~baseIOdictionary();
83 
84 
85  // Member functions
86 
87  //- Return complete path + object name if the file exists
88  // either in the case/processor or case otherwise null
89  virtual fileName filePath() const = 0;
90 
91  //- Name function is needed to disambiguate those inherited
92  // from regIOobject and dictionary
93  const word& name() const;
94 
95  //- ReadData function required for regIOobject read operation
96  virtual bool readData(Istream&);
97 
98  //- WriteData function required for regIOobject write operation
99  virtual bool writeData(Ostream&) const;
100 
101  //- Is object global
102  virtual bool global() const = 0;
103 
104 
105  // Member operators
106 
107  //- Assignment of other baseIOdictionary's entries to this
108  // baseIOdictionary
109  void operator=(const baseIOdictionary&);
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
void operator=(const baseIOdictionary &)
Assignment of other baseIOdictionary&#39;s entries to this.
baseIOdictionary(const IOobject &)
Construct given an IOobject.
A class for handling file names.
Definition: fileName.H:69
baseIOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO function...
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
virtual bool global() const =0
Is object global.
virtual fileName filePath() const =0
Return complete path + object name if the file exists.
virtual ~baseIOdictionary()
Destructor.
A class for handling words, derived from string.
Definition: word.H:59
const word & name() const
Name function is needed to disambiguate those inherited.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
TypeName("dictionary")
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
Namespace for OpenFOAM.
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.