CoolProp  6.6.1dev
An open-source fluid property and humid air property database
Public Member Functions | List of all members
CoolProp::CachedElement Class Reference

Detailed Description

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...
 
CoolPropDblpt ()
 

Constructor & Destructor Documentation

◆ CachedElement()

CoolProp::CachedElement::CachedElement ( )
inline

Default constructor.

Definition at line 41 of file CachedElement.h.

Member Function Documentation

◆ _do_cache()

void CoolProp::CachedElement::_do_cache ( double  value)
inline

Function to carry out the caching.

Definition at line 46 of file CachedElement.h.

◆ clear()

void CoolProp::CachedElement::clear ( )
inline

Clear the flag and the value.

Definition at line 79 of file CachedElement.h.

◆ operator bool()

CoolProp::CachedElement::operator bool ( )
inline

Cast to boolean, for checking if cached.

Definition at line 57 of file CachedElement.h.

◆ operator double()

CoolProp::CachedElement::operator double ( )
inline

Cast to double, for returning value.

Definition at line 62 of file CachedElement.h.

◆ operator=()

void CoolProp::CachedElement::operator= ( const double &  value)
inline

Assignment operator - sets the value and sets the flag.

Definition at line 52 of file CachedElement.h.

◆ pt()

CoolPropDbl& CoolProp::CachedElement::pt ( )
inline

Definition at line 83 of file CachedElement.h.


The documentation for this class was generated from the following file: