ARB
Public Member Functions | Friends | List of all members
cache::Cache< SMARTPTR > Class Template Reference

Cache for any SmartPtr type. More...

#include <cache.h>

Inheritance diagram for cache::Cache< SMARTPTR >:
Inheritance graph
[legend]

Public Member Functions

 Cache (size_t Size)
 
 ~Cache ()
 
size_t entries () const
 
size_t size () const
 
void resize (size_t new_size)
 
void flush ()
 flush the cache, i.e. uncache all elements More...
 

Friends

class CacheHandle< SMARTPTR >
 

Detailed Description

template<typename SMARTPTR>
class cache::Cache< SMARTPTR >

Cache for any SmartPtr type.

Definition at line 32 of file cache.h.

Constructor & Destructor Documentation

template<typename SMARTPTR>
cache::Cache< SMARTPTR >::Cache ( size_t  Size)
inline

create a new Cache

Parameters
Sizespecifies how many entries the Cache will hold at a time. Can be redefined later using resize().

Each cache entry is a SmartPtr (any flavour) which is represented by a CacheHandle.

Definition at line 184 of file cache.h.

template<typename SMARTPTR>
cache::Cache< SMARTPTR >::~Cache ( )
inline

destroy the Cache

Will invalidate all CacheHandles assigned to this Cache.

Definition at line 196 of file cache.h.

Member Function Documentation

template<typename SMARTPTR>
size_t cache::Cache< SMARTPTR >::entries ( ) const
inline
Returns
the number of currently cached CacheHandles

Definition at line 204 of file cache.h.

template<typename SMARTPTR>
size_t cache::Cache< SMARTPTR >::size ( ) const
inline
Returns
the maximum number of cached CacheHandles

Definition at line 209 of file cache.h.

Referenced by cache::Cache< SmartCharPtr >::~Cache().

template<typename SMARTPTR>
void cache::Cache< SMARTPTR >::resize ( size_t  new_size)
inline

change the size of the Cache.

Parameters
new_sizespecifies the number of cache entries (as in constructor)

Definition at line 214 of file cache.h.

Referenced by probe_input_data::set_cache_sizes().

template<typename SMARTPTR>
void cache::Cache< SMARTPTR >::flush ( )
inline

flush the cache, i.e. uncache all elements

Definition at line 220 of file cache.h.

Referenced by cache::Cache< SmartCharPtr >::~Cache().

Friends And Related Function Documentation

template<typename SMARTPTR>
friend class CacheHandle< SMARTPTR >
friend

Definition at line 173 of file cache.h.


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