base class for the product cache More...
#include <mia/core/productcache.hh>
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 |
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.
CProductCache::CProductCache | ( | const std::string & | name | ) |
This constructor registers the cache in the global product cache map
name | name of the handled factory |
void CProductCache::clear | ( | ) |
clear the cache
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.
enable |
|
protected |
Referenced by TProductCache< ProductPtr >::add().