CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
CachedElement Class Reference

#include <CPState.h>

Public Member Functions

 CachedElement ()
 Default constructor. More...
 
void operator= (const double &value)
 Assignment operator - sets the value and sets the flag. More...
 
 operator bool () const
 Cast to boolean, for checking if cached. More...
 
 operator double () const
 Cast to double, for returning value. More...
 
void clear ()
 Clear the flag and the value. More...
 

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 35 of file CPState.h.

Constructor & Destructor Documentation

CachedElement::CachedElement ( )
inline

Default constructor.

Definition at line 42 of file CPState.h.

Member Function Documentation

void CachedElement::clear ( )
inline

Clear the flag and the value.

Definition at line 50 of file CPState.h.

CachedElement::operator bool ( ) const
inline

Cast to boolean, for checking if cached.

Definition at line 46 of file CPState.h.

CachedElement::operator double ( ) const
inline

Cast to double, for returning value.

Definition at line 48 of file CPState.h.

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

Assignment operator - sets the value and sets the flag.

Definition at line 44 of file CPState.h.


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