CoolProp
6.6.0
An open-source fluid property and humid air property database
|
A class that contains the magic to cache a value.
Includes an "=" assignment operator and casting to boolean so you can do something like::
double CoolPropStateClassSI::d3phir_dTau3(double tau, double delta){ if (cache.d3phir_dTau3) { return cache.d3phir_dTau3; } else { cache.d3phir_dTau3 = pFluid->d3phir_dTau3(tau,delta); return cache.d3phir_dTau3; } };
Definition at line 32 of file CachedElement.h.
#include <CachedElement.h>
Public Member Functions | |
CachedElement () | |
Default constructor. More... | |
void | _do_cache (double value) |
Function to carry out the caching. More... | |
void | operator= (const double &value) |
Assignment operator - sets the value and sets the flag. More... | |
operator bool () | |
Cast to boolean, for checking if cached. More... | |
operator double () | |
Cast to double, for returning value. More... | |
void | clear () |
Clear the flag and the value. More... | |
CoolPropDbl & | pt () |
|
inline |
Default constructor.
Definition at line 41 of file CachedElement.h.
|
inline |
Function to carry out the caching.
Definition at line 46 of file CachedElement.h.
|
inline |
Clear the flag and the value.
Definition at line 79 of file CachedElement.h.
|
inline |
Cast to boolean, for checking if cached.
Definition at line 57 of file CachedElement.h.
|
inline |
Cast to double, for returning value.
Definition at line 62 of file CachedElement.h.
|
inline |
Assignment operator - sets the value and sets the flag.
Definition at line 52 of file CachedElement.h.
|
inline |
Definition at line 83 of file CachedElement.h.