dictionaryListEntry.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) 2016 OpenFOAM Foundation
9 Copyright (C) 2017 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::dictionaryListEntry
29
30Description
31 Read/write List of dictionaries.
32
33 The List entries get stored in a
34 dictionary which itself is stored in the parent dictionary with
35 keyword 'entryDDD' where DDD is the position in the parent dictionary.
36 The printing is again in List format - the keyword is only printed as
37 comment. Can be used to e.g. manipulate polyMesh/boundary files.
38
39SourceFiles
40 dictionaryListEntry.C
41 dictionaryListEntryIO.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef dictionaryListEntry_H
46#define dictionaryListEntry_H
47
48#include "dictionaryEntry.H"
49
50// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51
52namespace Foam
53{
54
55// Forward declaration of friend functions and operators
56
57class dictionaryListEntry;
58Ostream& operator<<(Ostream& os, const dictionaryListEntry& e);
59
60
61/*---------------------------------------------------------------------------*\
62 Class dictionaryListEntry Declaration
63\*---------------------------------------------------------------------------*/
66:
67 public dictionaryEntry
68{
69 // Private Member Functions
70
71 //- No copy construct
73
74
75public:
76
77 // Constructors
78
79 //- Construct from the parent dictionary and Istream
80 dictionaryListEntry(const dictionary& parentDict, Istream& is);
81
82 //- Construct as copy for the given parent dictionary
84 (
85 const dictionary& parentDict,
86 const dictionaryListEntry& dictEnt
87 );
89 autoPtr<entry> clone(const dictionary& parentDict) const
90 {
91 return autoPtr<entry>(new dictionaryListEntry(parentDict, *this));
92 }
93
94
95 // Member functions
96
97 //- Write
98 virtual void write(Ostream& os) const;
99
100 //- Return info proxy.
101 // Used to print token information to a stream
103 {
104 return *this;
105 }
106
107
108 // Ostream operator
111};
112
113
114template<>
116
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120} // End namespace Foam
121
122// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
123
124#endif
125
126// ************************************************************************* //
A helper class for outputting values to Ostream.
Definition: InfoProxy.H:52
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
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A keyword and a list of tokens is a 'dictionaryEntry'.
Read/write List of dictionaries.
autoPtr< entry > clone(const dictionary &parentDict) const
Construct on freestore as copy with reference to the.
InfoProxy< dictionaryListEntry > info() const
Return info proxy.
friend Ostream & operator<<(Ostream &os, const dictionaryListEntry &e)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
autoPtr< dictionary > clone() const
Construct and return clone.
Definition: dictionary.C:172
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
runTime write()
volScalarField & e
Definition: createFields.H:11