ATLAS Offline Software
Classes | Functions | Variables
python.AccumulatorCache Namespace Reference

Classes

class  AccumulatorCachable
 
class  AccumulatorDecorator
 
class  DataHandle
 
class  NotHashable
 

Functions

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

Variables

 _msg = logging.getLogger('AccumulatorCache')
 

Function Documentation

◆ AccumulatorCache()

def 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 228 of file AccumulatorCache.py.

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

Variable Documentation

◆ _msg

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

Definition at line 6 of file AccumulatorCache.py.

python.AccumulatorCache.AccumulatorCache
def AccumulatorCache(func=None, maxSize=128, verifyResult=AccumulatorDecorator.VERIFY_NOTHING, deepCopy=True)
Definition: AccumulatorCache.py:228