All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | List of all members
CheckPhotonLibraryJobs.CachedValue Class Reference

Public Member Functions

def __init__
 
def __call__
 
def __nonzero__
 

Public Attributes

 fetchProc
 
 cachedValue
 

Private Member Functions

def _fetchValue
 

Detailed Description

On the first call, it creates and returns an object.
On next calls, it returns the same object.

Definition at line 38 of file CheckPhotonLibraryJobs.py.

Constructor & Destructor Documentation

def CheckPhotonLibraryJobs.CachedValue.__init__ (   self,
  fetchProc 
)

Definition at line 42 of file CheckPhotonLibraryJobs.py.

42 
def __init__(self, fetchProc): self.fetchProc = fetchProc

Member Function Documentation

def CheckPhotonLibraryJobs.CachedValue.__call__ (   self,
  args,
  kwargs,
  Returns,
  the,
  cached,
  value 
)

Definition at line 43 of file CheckPhotonLibraryJobs.py.

43 
44  def __call__(self, *args, **kwargs) -> "Returns the cached value.":
45  try: return self.cachedValue
except AttributeError: return self._fetchValue(*args, **kwargs)
def CheckPhotonLibraryJobs.CachedValue.__nonzero__ (   self,
  Returns,
  whether,
  the,
  object,
  is,
  cached 
)

Definition at line 47 of file CheckPhotonLibraryJobs.py.

47 
48  def __nonzero__(self) -> "Returns whether the object is cached":
return hasattr(self, "cachedValue")
def CheckPhotonLibraryJobs.CachedValue._fetchValue (   self,
  args,
  kwargs 
)
private

Definition at line 49 of file CheckPhotonLibraryJobs.py.

49 
50  def _fetchValue(self, *args, **kwargs):
51  self.cachedValue = self.fetchProc(*args, **kwargs)
52  del self.fetchProc # not needed any more
return self.cachedValue

Member Data Documentation

CheckPhotonLibraryJobs.CachedValue.cachedValue

Definition at line 50 of file CheckPhotonLibraryJobs.py.

CheckPhotonLibraryJobs.CachedValue.fetchProc

Definition at line 42 of file CheckPhotonLibraryJobs.py.


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