13 template<
typename this_t,
typename datum_t,
typename output_t>
16 void const* cached_data =
nullptr;
24 cached_data =
nullptr;
38 void cached_call(
const std::vector<datum_t>& data,
bool break_on_error=
true) {
43 if(cached_data != &data) {
45 cache.resize(data.size());
51 for(
size_t di=0;di<data.size();di++) {
54 }
catch( std::exception& e){
56 cache[di] = output_t{};
57 if(break_on_error)
break;
void cached_call(const std::vector< datum_t > &data, bool break_on_error=true)
Definition: CachedCallHypothesis.h:38
CachedCallHypothesis()
Definition: CachedCallHypothesis.h:21
Definition: CachedCallHypothesis.h:14
bool got_error
Definition: CachedCallHypothesis.h:19
void clear_cache()
Definition: CachedCallHypothesis.h:23
std::vector< output_t > cache
Definition: CachedCallHypothesis.h:18
virtual output_t cached_call_wrapper(const datum_t &di)
This is how we access the data before calling – needed to say how this interfaces with the data...
Definition: CachedCallHypothesis.h:33