CProductCache Class Referenceabstract

base class for the product cache More...

#include <mia/core/productcache.hh>

Inheritance diagram for CProductCache:
[legend]

Public Member Functions

void clear ()
 clear the cache More...
 
 CProductCache (const std::string &name)
 
void enable_write (bool enable)
 

Protected Member Functions

bool is_enabled () const
 

Detailed Description

base class for the product cache

This is the base class for all product caches. Product caches are used to store results of the factory plugin handler creation method in order to avoid re-creating the same objects over and over again.

Normally a product cache is disabled, because most programs don't make use of the same filters over and over again.

Definition at line 41 of file productcache.hh.

Constructor & Destructor Documentation

◆ CProductCache()

CProductCache::CProductCache ( const std::string &  name)

This constructor registers the cache in the global product cache map

Parameters
namename of the handled factory

Member Function Documentation

◆ clear()

void CProductCache::clear ( )

clear the cache

◆ enable_write()

void CProductCache::enable_write ( bool  enable)

enable or disable the cache accululation according to the given flag If the flag is set to true, then all newly created objects will be added to the cache, if it is set to false, all objects that are in the cache may be reused, but no new ones are added to the cache. If you want to truely not use uncached values, you must clear the cache by calling clear() and disable it.

Parameters
enable

◆ is_enabled()

bool CProductCache::is_enabled ( ) const
protected
Returns
whether this cache is enabled

Referenced by TProductCache< ProductPtr >::add().


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