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 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::dictionaryListEntry
29 
30 Description
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 
39 SourceFiles
40  dictionaryListEntry.C
41  dictionaryListEntryIO.C
42 
43 \*---------------------------------------------------------------------------*/
44 
45 #ifndef Foam_dictionaryListEntry_H
46 #define Foam_dictionaryListEntry_H
47 
48 #include "dictionaryEntry.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 // Forward Declarations
56 
57 class dictionaryListEntry;
58 Ostream& operator<<(Ostream& os, const dictionaryListEntry& e);
59 
60 template<>
61 Ostream& operator<<(Ostream&, const InfoProxy<dictionaryListEntry>&);
62 
63 
64 /*---------------------------------------------------------------------------*\
65  Class dictionaryListEntry Declaration
66 \*---------------------------------------------------------------------------*/
67 
69 :
70  public dictionaryEntry
71 {
72 public:
73 
74  // Generated Methods
75 
76  //- No copy construct
78 
79 
80  // Constructors
81 
82  //- Construct from the parent dictionary and Istream
83  dictionaryListEntry(const dictionary& parentDict, Istream& is);
84 
85  //- Construct as copy for the given parent dictionary
87  (
88  const dictionary& parentDict,
89  const dictionaryListEntry& dictEnt
90  );
91 
92  autoPtr<entry> clone(const dictionary& parentDict) const
93  {
94  return autoPtr<entry>(new dictionaryListEntry(parentDict, *this));
95  }
96 
97 
98  // Member Functions
99 
100  //- Write
101  virtual void write(Ostream& os) const;
102 
103  //- Return info proxy,
104  //- used to print token information to a stream
105  InfoProxy<dictionaryListEntry> info() const noexcept { return *this; }
106 
107 
108  // Ostream Operator
109 
111 };
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #endif
121 
122 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:120
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
dictionaryListEntry(const dictionaryListEntry &)=delete
No copy construct.
A keyword and a list of tokens is a &#39;dictionaryEntry&#39;.
autoPtr< dictionary > clone() const
Construct and return clone.
Definition: dictionary.C:165
const dimensionedScalar e
Elementary charge.
Definition: createFields.H:11
Read/write List of dictionaries.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:55
const direction noexcept
Definition: Scalar.H:258
OBJstream os(runTime.globalPath()/outputName)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:76
A helper class for outputting values to Ostream.
Definition: ensightCells.H:43
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
friend Ostream & operator<<(Ostream &os, const dictionaryListEntry &e)
InfoProxy< dictionaryListEntry > info() const noexcept
Return info proxy, used to print token information to a stream.
Namespace for OpenFOAM.
virtual void write(Ostream &os) const
Write.