#include <Cache.hh>
|
| Cache () |
|
| Cache (size_t s) |
|
void | clear (bool keepstats=false) |
| clear the cache, discarding all values. More...
|
|
size_t | peak () const |
|
size_t | size () const |
|
ResType | eval (const FuncType &func, const ParamType ¶m) const |
|
bool | should_insert (const FuncType &) const |
|
std::pair< bool, ResType > | insert (const FuncType &hom, const ParamType &node) |
|
◆ hash_map
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
typedef hash_map< std::pair<FuncType, ParamType>, ResType >::type Cache< FuncType, ParamType, ResType, EvalFunc >::hash_map |
|
private |
◆ Cache() [1/2]
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
Cache< FuncType, ParamType, ResType, EvalFunc >::Cache |
( |
| ) |
|
|
inline |
◆ Cache() [2/2]
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
Cache< FuncType, ParamType, ResType, EvalFunc >::Cache |
( |
size_t |
s | ) |
|
|
inline |
◆ clear()
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
void Cache< FuncType, ParamType, ResType, EvalFunc >::clear |
( |
bool |
keepstats = false | ) |
|
|
inline |
clear the cache, discarding all values.
References Cache< FuncType, ParamType, ResType, EvalFunc >::cache_, ext_hash_map< Key, Data, HashKey, EqualKey >::clear(), and Cache< FuncType, ParamType, ResType, EvalFunc >::peak().
Referenced by GHom::garbage(), and GShom::garbage().
◆ eval()
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
ResType Cache< FuncType, ParamType, ResType, EvalFunc >::eval |
( |
const FuncType & |
func, |
|
|
const ParamType & |
param |
|
) |
| const |
|
inline |
◆ insert()
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
std::pair<bool,ResType> Cache< FuncType, ParamType, ResType, EvalFunc >::insert |
( |
const FuncType & |
hom, |
|
|
const ParamType & |
node |
|
) |
| |
|
inline |
References Cache< FuncType, ParamType, ResType, EvalFunc >::cache_, Cache< FuncType, ParamType, ResType, EvalFunc >::eval(), ext_hash_map< Key, Data, HashKey, EqualKey >::find(), ext_hash_map< Key, Data, HashKey, EqualKey >::insert(), and Cache< FuncType, ParamType, ResType, EvalFunc >::should_insert().
Referenced by GHom::has_image(), and GHom::operator()().
◆ peak()
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
size_t Cache< FuncType, ParamType, ResType, EvalFunc >::peak |
( |
| ) |
const |
|
inline |
References Cache< FuncType, ParamType, ResType, EvalFunc >::peak_, and Cache< FuncType, ParamType, ResType, EvalFunc >::size().
Referenced by GShom::cache_peak(), and Cache< FuncType, ParamType, ResType, EvalFunc >::clear().
◆ should_insert()
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
bool Cache< FuncType, ParamType, ResType, EvalFunc >::should_insert |
( |
const FuncType & |
| ) |
const |
|
inline |
◆ size()
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
size_t Cache< FuncType, ParamType, ResType, EvalFunc >::size |
( |
| ) |
const |
|
inline |
References Cache< FuncType, ParamType, ResType, EvalFunc >::cache_, and ext_hash_map< Key, Data, HashKey, EqualKey >::size().
Referenced by GShom::cache_size(), and Cache< FuncType, ParamType, ResType, EvalFunc >::peak().
◆ cache_
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
Referenced by Cache< FuncType, ParamType, ResType, EvalFunc >::clear(), Cache< FuncType, ParamType, ResType, EvalFunc >::insert(), and Cache< FuncType, ParamType, ResType, EvalFunc >::size().
◆ peak_
template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
size_t Cache< FuncType, ParamType, ResType, EvalFunc >::peak_ |
|
mutableprivate |
The documentation for this class was generated from the following file: