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 Copyright (C) 2020-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::baseIOdictionary
29
30Description
31 baseIOdictionary is derived from dictionary and IOobject to give the
32 dictionary automatic IO functionality via the objectRegistry.
33
34 To facilitate IO, baseIOdictionary is provided with a constructor from
35 IOobject and with readData/writeData functions.
36
37SourceFiles
38 baseIOdictionary.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef baseIOdictionary_H
43#define baseIOdictionary_H
44
45#include "dictionary.H"
46#include "regIOobject.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class baseIOdictionary Declaration
55\*---------------------------------------------------------------------------*/
58:
59 public regIOobject,
60 public dictionary
61{
62 // Private Data
63
64 static bool writeDictionaries;
65
66
67public:
68
69 //- Declare type-name, virtual type (with debug switch)
70 TypeName("dictionary");
71
72
73 // Generated Methods
74
75 //- Copy construct
76 baseIOdictionary(const baseIOdictionary&) = default;
77
78 //- Move construct
80
81 //- Destructor
82 virtual ~baseIOdictionary() = default;
83
84
85 // Constructors
86
87 //- Construct given an IOobject
88 //- and optional fallback dictionary content (ununsed)
89 // A null dictionary pointer is treated like an empty dictionary.
90 explicit baseIOdictionary
91 (
92 const IOobject& io,
93 const dictionary* fallback = nullptr
94 );
95
96 //- Construct given an IOobject and fallback dictionary
97 //- content (ununsed)
99
100 //- Construct given an IOobject and Istream (ununsed)
101 baseIOdictionary(const IOobject& io, Istream& is);
102
103
104 // Member Functions
105
106 //- Return complete path + object name if the file exists
107 //- either in the case/processor or case otherwise null
108 virtual fileName filePath() const = 0;
109
110 //- Name function is needed to disambiguate those inherited
111 //- from regIOobject and dictionary
112 const word& name() const;
113
114 //- The readData function required by regIOobject read operation
115 virtual bool readData(Istream&);
116
117 //- The writeData function required by regIOobject write operation
118 virtual bool writeData(Ostream&) const;
119
120 //- Is object global
121 virtual bool global() const = 0;
122
123
124 // Member Operators
125
126 //- Copy assignment of dictionary entries (leave regIOobject untouched)
127 void operator=(const baseIOdictionary& rhs);
128
129 //- Copy assignment of dictionary entries
131};
132
133
134// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136} // End namespace Foam
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140#endif
141
142// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:170
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
baseIOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO function...
virtual bool writeData(Ostream &) const
The writeData function required by regIOobject write operation.
virtual fileName filePath() const =0
virtual ~baseIOdictionary()=default
Destructor.
baseIOdictionary(const baseIOdictionary &)=default
Copy construct.
baseIOdictionary(baseIOdictionary &&)=default
Move construct.
TypeName("dictionary")
Declare type-name, virtual type (with debug switch)
void operator=(const baseIOdictionary &rhs)
Copy assignment of dictionary entries (leave regIOobject untouched)
virtual bool readData(Istream &)
The readData function required by regIOobject read operation.
virtual bool global() const =0
Is object global.
const word & name() const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
A class for handling file names.
Definition: fileName.H:76
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:76
A class for handling words, derived from Foam::string.
Definition: word.H:68
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73