BlockIt
blockit::library::CacheManager Class Reference
Inheritance diagram for blockit::library::CacheManager:

List of all members.

Public Member Functions

def __init__
def fromCache
def fromCacheSerialized
def unSerialize
def clearCache
def toCache
def genCacheName

Properties

 ext = property( fget=lambda x: x._ext )

Private Attributes

 _ext

Detailed Description

Class to manage cached (i.e. pickled) blocks.  Need to inherit from
this class and add a genCacheName() method which takes a block and returns
a tuple of (boolean, string).  See virtual method genCacheName() for details.

Definition at line 262 of file library.py.


Constructor & Destructor Documentation

def blockit::library::CacheManager::__init__ (   self,
  ext = '.cache' 
)

Definition at line 268 of file library.py.


Member Function Documentation

def blockit::library::CacheManager::clearCache (   self,
  blk 
)
Clear all caches related to the block.

Definition at line 327 of file library.py.

def blockit::library::CacheManager::fromCache (   self,
  blk 
)
Check for a cached version of the given blk.  If there is and the
block version number matches the passed in block version, then it is
returned; else the cache is cleared and None is returned.

Definition at line 271 of file library.py.

def blockit::library::CacheManager::fromCacheSerialized (   self,
  blk 
)
Just read the pickled version of the block from the cache file if
it exists and return it without unpickling.

Definition at line 296 of file library.py.

def blockit::library::CacheManager::genCacheName (   self,
  blk 
)
Takes a block and returns a tuple.  The first element is a
two-tuple with the fist elementa boolean on whether the cacheName is
older than the originating blk (i.e. the provided argument), the
second element is if the cacheName exists.  The second arg in the main
tuple is the name of the cache file.  For example:

( ( true, true ), "myCache.pkl" ) - means that the cache file exists
and is newer than the file that contains the passed in block and the
name of the cache file is "myCache.pkl".

Reimplemented in blockit::Fortran::library::FortranCacheManager.

Definition at line 362 of file library.py.

def blockit::library::CacheManager::toCache (   self,
  blk 
)
Write a blk to a cache file.

Definition at line 338 of file library.py.

def blockit::library::CacheManager::unSerialize (   self,
  serial 
)
Unserialize a cached file.  This is just a wrapper for pickle.loads
method. 

Definition at line 320 of file library.py.


Member Data Documentation

Definition at line 268 of file library.py.


Property Documentation

blockit::library::CacheManager::ext = property( fget=lambda x: x._ext ) [static]

Definition at line 378 of file library.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Properties