IMP  2.1.0
The Integrative Modeling Platform
IMP::base::Memoizer< Generator, Checker > Class Template Reference

#include <IMP/base/cache.h>

Public Types

typedef Generator::argument_type Key
 
typedef Generator::result_type Value
 

Public Member Functions

Generator & access_generator ()
 
 checker_ (checker)
 
const Value & get () const
 
const Generator & get_generator () const
 
double get_hit_rate () const
 
 has_result_ (false)
 
 num_misses_ (0)
 
 num_stats_ (0)
 
void reset ()
 
void set (const Value &v) const
 Update the stored result manually.
 

Detailed Description

template<class Generator, class Checker = std::equal_to<typename Generator::result_type>>
class IMP::base::Memoizer< Generator, Checker >

This is a helper class for writing memoizers: things that store the results of a computation to look up later. The result type must support

  • operator=
  • operator==
  • default construction

Definition at line 40 of file base/cache.h.


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