Loading [MathJax]/extensions/TeX/AMSsymbols.js
CoolProp
6.7.1dev
An open-source fluid property and humid air property database
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
r
s
t
u
v
w
x
Variables
Typedefs
Enumerations
Enumerator
b
d
f
g
h
i
n
p
q
r
s
t
v
x
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
e
i
m
n
o
p
r
s
t
v
z
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
q
r
s
t
u
v
Variables
Typedefs
b
c
i
m
t
u
v
Enumerations
Enumerator
c
m
t
Macros
_
a
c
d
e
f
i
l
m
n
p
r
t
u
x
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
include
CachedElement.h
Go to the documentation of this file.
1
/*
2
* CachedElement.h
3
*
4
* Created on: 21 Dec 2013
5
* Author: jowr
6
*/
7
8
#ifndef CACHEDELEMENT_H_
9
#define CACHEDELEMENT_H_
10
11
#include "
CoolPropTools.h
"
12
#include "
DataStructures.h
"
13
14
namespace
CoolProp
{
15
32
class
CachedElement
33
{
34
35
private
:
36
bool
is_cached;
37
CoolPropDbl
value;
38
39
public
:
41
CachedElement
() {
42
this->
clear
();
43
};
44
46
void
_do_cache
(
double
value) {
47
this->value = value;
48
this->is_cached =
true
;
49
}
50
52
void
operator=
(
const
double
& value) {
53
_do_cache
(value);
54
};
55
57
operator
bool() {
58
return
is_cached;
59
};
60
62
operator
double() {
63
if
(is_cached) {
64
return
static_cast<
double
>
(value);
65
}
else
{
66
throw
std::exception();
67
}
68
}
69
#ifndef COOLPROPDBL_MAPS_TO_DOUBLE
70
operator
CoolPropDbl
() {
71
if
(is_cached) {
72
return
value;
73
}
else
{
74
throw
std::exception();
75
}
76
}
77
#endif
79
void
clear
() {
80
is_cached =
false
;
81
this->value = _HUGE;
82
};
83
CoolPropDbl
&
pt
() {
84
return
this->value;
85
}
86
};
87
88
}
/* namespace CoolProp */
89
#endif
/* CACHEDELEMENT_H_ */
Generated on Mon Mar 17 2025 04:25:23 for CoolProp by
1.9.1