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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::baseIOdictionary
28 
29 Description
30  baseIOdictionary is derived from dictionary and IOobject to give the
31  dictionary automatic IO functionality via the objectRegistry.
32 
33  To facilitate IO, baseIOdictionary is provided with a constructor from
34  IOobject and with readData/writeData functions.
35 
36 SourceFiles
37  baseIOdictionary.C
38  baseIOdictionaryIO.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef baseIOdictionary_H
43 #define baseIOdictionary_H
44 
45 #include "dictionary.H"
46 #include "regIOobject.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class baseIOdictionary Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class baseIOdictionary
58 :
59  public regIOobject,
60  public dictionary
61 {
62  // Private data
63 
64  static bool writeDictionaries;
65 
66 public:
67 
68  TypeName("dictionary");
69 
70 
71  // Constructors
72 
73  //- Construct given an IOobject
74  baseIOdictionary(const IOobject&);
75 
76  //- Construct given an IOobject and dictionary
77  baseIOdictionary(const IOobject&, const dictionary&);
78 
79  //- Construct given an IOobject and Istream
81 
82 
83  //- Destructor
84  virtual ~baseIOdictionary();
85 
86 
87  // Member functions
88 
89  //- Return complete path + object name if the file exists
90  // either in the case/processor or case otherwise null
91  virtual fileName filePath() const = 0;
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  virtual bool readData(Istream&);
99 
100  //- WriteData function required for regIOobject write operation
101  virtual bool writeData(Ostream&) const;
102 
103  //- Is object global
104  virtual bool global() const = 0;
105 
106 
107  // Member operators
108 
109  //- Assignment of other baseIOdictionary's entries to this
110  // baseIOdictionary
111  void operator=(const baseIOdictionary&);
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
regIOobject.H
Foam::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::baseIOdictionary::readData
virtual bool readData(Istream &)
ReadData function required for regIOobject read operation.
Definition: baseIOdictionaryIO.C:33
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::baseIOdictionary::writeData
virtual bool writeData(Ostream &) const
WriteData function required for regIOobject write operation.
Definition: baseIOdictionaryIO.C:51
Foam::baseIOdictionary::name
const word & name() const
Name function is needed to disambiguate those inherited.
Definition: baseIOdictionary.C:88
Foam::baseIOdictionary::global
virtual bool global() const =0
Is object global.
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::baseIOdictionary
baseIOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO function...
Definition: baseIOdictionary.H:56
Foam::baseIOdictionary::TypeName
TypeName("dictionary")
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:67
dictionary.H
Foam::baseIOdictionary::filePath
virtual fileName filePath() const =0
Return complete path + object name if the file exists.
Foam::baseIOdictionary::~baseIOdictionary
virtual ~baseIOdictionary()
Destructor.
Definition: baseIOdictionary.C:82
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::baseIOdictionary::operator=
void operator=(const baseIOdictionary &)
Assignment of other baseIOdictionary's entries to this.
Definition: baseIOdictionary.C:96
Foam::baseIOdictionary::baseIOdictionary
baseIOdictionary(const IOobject &)
Construct given an IOobject.
Definition: baseIOdictionary.C:48