ATLAS Offline Software
Loading...
Searching...
No Matches
python.AccumulatorCache Namespace Reference

Classes

class  AccumulatorCachable
class  AccumulatorDecorator
class  DataHandle
class  NotHashable

Functions

 AccumulatorCache (func=None, maxSize=128, verifyResult=AccumulatorDecorator.VERIFY_NOTHING, deepCopy=True)

Variables

 _msg = logging.getLogger('AccumulatorCache')

Function Documentation

◆ AccumulatorCache()

python.AccumulatorCache.AccumulatorCache ( func = None,
maxSize = 128,
verifyResult = AccumulatorDecorator.VERIFY_NOTHING,
deepCopy = True )
Function decorator, implements memoization.

Keyword arguments:
    maxSize: maximum size for the cache associated with the function (default 128)
    verifyResult:   takes two possible values
                    
                    AccumulatorDecorator.VERIFY_NOTHING -   default, the cached function result is returned with no verification
                    AccumulatorDecorator.VERIFY_HASH -      before returning the cached function value, the hash of the
                                                            result is checked to verify if this object was not modified
                                                            between function calls
    deepCopy:   if True (default) a deep copy of the function result will be stored in the cache.

Returns:
    An instance of AccumulatorDecorator.

Definition at line 229 of file AccumulatorCache.py.

230 verifyResult = AccumulatorDecorator.VERIFY_NOTHING, deepCopy = True):
231 """Function decorator, implements memoization.
232
233 Keyword arguments:
234 maxSize: maximum size for the cache associated with the function (default 128)
235 verifyResult: takes two possible values
236
237 AccumulatorDecorator.VERIFY_NOTHING - default, the cached function result is returned with no verification
238 AccumulatorDecorator.VERIFY_HASH - before returning the cached function value, the hash of the
239 result is checked to verify if this object was not modified
240 between function calls
241 deepCopy: if True (default) a deep copy of the function result will be stored in the cache.
242
243 Returns:
244 An instance of AccumulatorDecorator.
245 """
246
247 def wrapper_accumulator(func):
248 return AccumulatorDecorator(func, maxSize, verifyResult, deepCopy)
249
250 return wrapper_accumulator(func) if func else wrapper_accumulator

Variable Documentation

◆ _msg

python.AccumulatorCache._msg = logging.getLogger('AccumulatorCache')
protected

Definition at line 6 of file AccumulatorCache.py.