Loading...
Searching...
No Matches
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 Foam_baseIOdictionary_H
43#define Foam_baseIOdictionary_H
44
45#include "dictionary.H"
46#include "regIOobject.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
53/*---------------------------------------------------------------------------*\
54 Class baseIOdictionary Declaration
55\*---------------------------------------------------------------------------*/
56
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
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
128
129 //- Copy assignment of dictionary entries
130 void operator=(const baseIOdictionary& rhs)
131 {
133 }
134
135 //- Move assignment of dictionary entries
137 {
138 dictionary::operator=(std::move(static_cast<dictionary&>(rhs)));
139 }
140};
142
143// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144
145} // End namespace Foam
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149#endif
150
151// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
friend Ostream & operator(Ostream &os, const UILList< DLListBase, T > &lst)
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
Return complete path + object name if the file exists either in the case/processor or case otherwise ...
virtual ~baseIOdictionary()=default
Destructor.
baseIOdictionary(const baseIOdictionary &)=default
Copy construct.
void operator=(baseIOdictionary &&rhs)
Move assignment of dictionary entries.
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.
virtual bool readData(Istream &)
The readData function required by regIOobject read operation.
virtual bool global() const =0
Is object global.
const word & name() const
Name function is needed to disambiguate those inherited from regIOobject and dictionary.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
dictionary()
Default construct, a top-level empty dictionary.
Definition dictionary.C:68
void operator=(const dictionary &rhs)
Copy assignment.
Definition dictionary.C:886
A class for handling file names.
Definition fileName.H:75
regIOobject(const IOobject &io, const bool isTimeObject=false)
Construct from IOobject. The optional flag adds special handling if the object is the top-level regIO...
Definition regIOobject.C:43
A class for handling words, derived from Foam::string.
Definition word.H:66
const auto & io
const auto & fallback
Namespace for OpenFOAM.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68