DDD  1.9.0.20240826145154
Public Member Functions | Private Types | Private Attributes | List of all members
Cache< FuncType, ParamType, ResType, EvalFunc > Class Template Reference

#include <Cache.hh>

Collaboration diagram for Cache< FuncType, ParamType, ResType, EvalFunc >:
Collaboration graph

Public Member Functions

 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 &param) const
 
bool should_insert (const FuncType &) const
 
std::pair< bool, ResType > insert (const FuncType &hom, const ParamType &node)
 

Private Types

typedef hash_map< std::pair< FuncType, ParamType >, ResType >::type hash_map
 

Private Attributes

size_t peak_
 
hash_map cache_
 

Member Typedef Documentation

◆ 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

Constructor & Destructor Documentation

◆ 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

Member Function Documentation

◆ clear()

template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
void Cache< FuncType, ParamType, ResType, EvalFunc >::clear ( bool  keepstats = false)
inline

◆ 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

◆ peak()

template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
size_t Cache< FuncType, ParamType, ResType, EvalFunc >::peak ( ) const
inline

◆ 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

Member Data Documentation

◆ cache_

template<typename FuncType , typename ParamType , typename ResType , typename EvalFunc = int>
hash_map Cache< FuncType, ParamType, ResType, EvalFunc >::cache_
private

◆ 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:

Please comment this page and report errors about it on the RefDocComments page.
Generated on Mon Aug 26 2024 14:54:00 for DDD by doxygen 1.9.1