8#ifndef CACHEDELEMENT_H_
9#define CACHEDELEMENT_H_
40 bool is_cached =
false;
52 this->is_cached =
true;
68 return static_cast<double>(value);
70 throw std::exception();
73#ifndef COOLPROPDBL_MAPS_TO_DOUBLE
78 throw std::exception();
92template<
typename NumType>
108 this->is_cached =
true;
124 return static_cast<double>(value);
126 throw std::exception();
129#ifndef COOLPROPDBL_MAPS_TO_DOUBLE
134 throw std::exception();
154 std::size_t inext = 0;
155 std::array<double, N> m_values = create_filled_array<double, N>(_HUGE);
156 std::array<bool, N> m_cached = create_filled_array<bool, N>(
false);
160 memset(m_values.data(), 0,
sizeof(m_values));
161 memset(m_cached.data(),
false,
sizeof(m_cached));
168 throw ValueError(
"No more cache elements available");