libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory > Class Template Referenceabstract

A base cache class, for deriving from to provide the real functionality. More...

#include <cache.hpp>

Inheritance diagram for jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >:
[legend]

Classes

class  find_range_data
 This class creates the data for a particular key, using the supplied factory. More...
 
class  flush_cache
 This class flushes the internal associative collection of the cache according to the flush policy. More...
 
struct  range_data
 

Public Types

typedef Factory factory_type
 The factory that is used to create a range-data value for a particular key. More...
 
typedef factory_type::key_type key_type
 The type of the key. More...
 
typedef factory_type::value_type value_type
 The type of the range-data. More...
 

Public Member Functions

__stdcall base (const base &)
 
virtual __stdcall ~base (void) noexcept(true)
 
base &__fastcall operator= (const base &)
 
virtual bool __fastcall empty () const noexcept(true)=0
 Returns "true" iff the internal, associative collection is empty. More...
 
virtual void __fastcall clear ()=0
 This function will reset any statistics upon clearing all contents from the internal, associative collection. More...
 
virtual void __fastcall flush ()=0
 Flush the contents of the cache according to the flush policy. More...
 

Protected Member Functions

__stdcall base (const factory_type &f)
 
const factory_type &__fastcall data_factory () const noexcept(true)
 

Detailed Description

template<class Factory>
class jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >

A base cache class, for deriving from to provide the real functionality.

This class provides a low-level interface for the various cache types that can be declared to allow some sort of compatibility and flexibility between them. It also contains the factory, that identifies the basic properties of a cache: the key and value types. Flush policies, statistics and threading are all extra sugar, to some extent.

Definition at line 273 of file cache.hpp.

Member Typedef Documentation

◆ factory_type

template<class Factory >
typedef Factory jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >::factory_type

The factory that is used to create a range-data value for a particular key.

Definition at line 275 of file cache.hpp.

◆ key_type

template<class Factory >
typedef factory_type::key_type jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >::key_type

The type of the key.

Definition at line 276 of file cache.hpp.

◆ value_type

template<class Factory >
typedef factory_type::value_type jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >::value_type

The type of the range-data.

Definition at line 277 of file cache.hpp.

Constructor & Destructor Documentation

◆ base() [1/2]

template<class Factory >
base< Factory >::base ( const base< Factory > &  r)
inline

Definition at line 144 of file cache_impl.hpp.

◆ ~base()

template<class Factory >
base< Factory >::~base ( void  )
inlinevirtualnoexcept

Definition at line 149 of file cache_impl.hpp.

◆ base() [2/2]

template<class Factory >
__stdcall jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >::base ( const factory_type f)
inlineexplicitprotected

Definition at line 356 of file cache.hpp.

Member Function Documentation

◆ clear()

template<class Factory >
virtual void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >::clear ( )
pure virtual

This function will reset any statistics upon clearing all contents from the internal, associative collection.

Implemented in jmmcg::LIBJMMCG_VER_NAMESPACE::cache::ro< Factory, FP, ThrT, Stats >.

◆ data_factory()

template<class Factory >
const base< Factory >::factory_type & base< Factory >::data_factory ( void  ) const
inlineprotectednoexcept

Definition at line 159 of file cache_impl.hpp.

◆ empty()

template<class Factory >
virtual bool __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >::empty ( ) const
pure virtualnoexcept

Returns "true" iff the internal, associative collection is empty.

Implemented in jmmcg::LIBJMMCG_VER_NAMESPACE::cache::ro< Factory, FP, ThrT, Stats >.

◆ flush()

template<class Factory >
virtual void __fastcall jmmcg::LIBJMMCG_VER_NAMESPACE::cache::base< Factory >::flush ( )
pure virtual

Flush the contents of the cache according to the flush policy.

The flush policy must be specified by a deriving class. The direct call to "flush" is run on the same thread, not another thread wrt the caller.

Implemented in jmmcg::LIBJMMCG_VER_NAMESPACE::cache::ro< Factory, FP, ThrT, Stats >.

◆ operator=()

template<class Factory >
base< Factory > & base< Factory >::operator= ( const base< Factory > &  r)
inline

Definition at line 153 of file cache_impl.hpp.


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