|
| ComputationCache (ComputeFn computeFn, HashFn hashFn, size_t maxResults=10000, ObjectPoolPtr objectPool=ObjectPool::defaultObjectPool()) |
|
void | clear () |
| Removes all the stored computation information from the cache.
|
|
void | erase (const T &args) |
| Removes stored information about a specific computation result.
|
|
size_t | getMaxComputations () const |
| Returns the maximum number of stored computations in the cache.
|
|
void | setMaxComputations (size_t maxComputations) |
| Defines the maximum number of stored computations allowed in the cache. May trigger deallocation.
|
|
size_t | cachedComputations () const |
| Returns the number of stored computations.
|
|
ConstObjectPtr | get (const T &args, MissingBehaviour missingBehaviour=ComputeIfMissing) |
|
void | set (const T &args, const Object *obj, StoreMode storeMode) |
| Registers the result of a computation explicitly.
|
|
ObjectPool * | objectPool () const |
| Returns the ObjectPool object used by this computation cache.
|
|
| IE_CORE_DECLAREMEMBERPTR (RefCounted) |
|
void | addRef () const |
| Add a reference to the current object.
|
|
void | removeRef () const |
| Remove a reference from the current object.
|
|
RefCount | refCount () const |
| Returns the current reference count.
|
|
template<typename T>
class IECore::ComputationCache< T >
LRUCache for generic computation that results on Object derived classes. It uses ObjectPool for the storage and retrieval of the computation results, and internally it only holds a map of computationHash to objectHash. The get functions will return the resulting Object, which should be copied prior to modification. The retrieve function will only query the cache and not force computation.