8#ifndef CACHEDELEMENT_H_
9#define CACHEDELEMENT_H_
39 bool is_cached =
false;
51 this->is_cached =
true;
67 return static_cast<double>(value);
69 throw std::exception();
72#ifndef COOLPROPDBL_MAPS_TO_DOUBLE
77 throw std::exception();
91template <
typename NumType>
106 this->is_cached =
true;
122 return static_cast<double>(value);
124 throw std::exception();
127#ifndef COOLPROPDBL_MAPS_TO_DOUBLE
132 throw std::exception();
151 std::size_t inext = 0;
152 std::array<double, N> m_values = create_filled_array<double, N>(_HUGE);
153 std::array<bool, N> m_cached = create_filled_array<bool, N>(
false);
157 memset(m_values.data(), 0,
sizeof(m_values));
158 memset(m_cached.data(),
false,
sizeof(m_cached));
165 throw ValueError(
"No more cache elements available");