OpenFOAM: API Guide
v2112
The open source CFD toolbox
demandDrivenEntry.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) 2013 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::demandDrivenEntry
28
29
Description
30
Class for demand-driven dictionary entries
31
32
Holds a reference to a dictionary, which is then queried if the value
33
is requested and has not already been cached
34
35
SourceFiles
36
demandDrivenEntry.C
37
demandDrivenEntryI.H
38
39
\*---------------------------------------------------------------------------*/
40
41
#ifndef demandDrivenEntry_H
42
#define demandDrivenEntry_H
43
44
#include "
dictionary.H
"
45
46
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48
namespace
Foam
49
{
50
51
/*---------------------------------------------------------------------------*\
52
Class demandDrivenEntry Declaration
53
\*---------------------------------------------------------------------------*/
54
55
template
<
class
Type>
56
class
demandDrivenEntry
57
{
58
private
:
59
60
// Private data
61
62
//- Reference to the dictionary
63
const
dictionary
& dict_;
64
65
//- Keyword to look up
66
const
word
keyword_;
67
68
//- Value
69
mutable
Type value_;
70
71
//- Flag to say that the value has been stored
72
mutable
bool
stored_;
73
74
75
public
:
76
77
//- Constructors
78
79
//- Construct from dictionary and value - cannot be re-read
80
demandDrivenEntry
81
(
82
const
dictionary
&
dict
,
83
const
Type&
value
84
);
85
86
87
//- Construct from dictionary and keyword
88
demandDrivenEntry
89
(
90
const
dictionary
&
dict
,
91
const
word
& keyword
92
);
93
94
95
//- Construct from dictionary, keyword and default value
96
demandDrivenEntry
97
(
98
const
dictionary
&
dict
,
99
const
word
& keyword,
100
const
Type& defaultValue,
101
const
bool
readIfPresent
=
true
102
);
103
104
//- Copy constructor
105
demandDrivenEntry
(
const
demandDrivenEntry
& dde);
106
107
108
// Public Member Functions
109
110
//- Initialise
111
inline
void
initialise
()
const
;
112
113
//- Return the value
114
inline
const
Type&
value
()
const
;
115
116
//- Set the value
117
inline
void
setValue
(
const
Type&
value
);
118
119
//- Reset the demand-driven entry
120
inline
void
reset
();
121
};
122
123
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124
125
}
// End namespace Foam
126
127
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128
129
#include "
demandDrivenEntryI.H
"
130
131
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133
#ifdef NoRepository
134
#include "
demandDrivenEntry.C
"
135
#endif
136
137
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138
139
#endif
140
141
// ************************************************************************* //
Foam::demandDrivenEntry
Class for demand-driven dictionary entries.
Definition:
demandDrivenEntry.H:56
Foam::demandDrivenEntry::initialise
void initialise() const
Initialise.
Definition:
demandDrivenEntryI.H:33
Foam::demandDrivenEntry::setValue
void setValue(const Type &value)
Set the value.
Definition:
demandDrivenEntryI.H:53
Foam::demandDrivenEntry::value
const Type & value() const
Return the value.
Definition:
demandDrivenEntryI.H:44
Foam::demandDrivenEntry::reset
void reset()
Reset the demand-driven entry.
Definition:
demandDrivenEntryI.H:62
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition:
dictionary.H:126
Foam::word
A class for handling words, derived from Foam::string.
Definition:
word.H:68
demandDrivenEntryI.H
demandDrivenEntry.C
dictionary.H
Foam
Namespace for OpenFOAM.
Definition:
atmBoundaryLayer.C:34
dict
dictionary dict
Definition:
searchingEngine.H:14
readIfPresent
propsDict readIfPresent("fields", acceptFields)
src
OpenFOAM
primitives
demandDrivenEntry
demandDrivenEntry.H
Generated by
1.9.5
OPENFOAM® is a registered
trademark
of OpenCFD Ltd.