rbmatlab 0.10.01
Public Member Functions | Static Public Member Functions | Public Attributes
CacheableObject Class Reference

Detailed Description

class which wraps an object pointer to an object that is stored somewhere on the hdd (in a cache)

As the wrapped object is already stored somewhere, it is not stored if the CacheableObject is stored. Instead only the filename and some consistency hash are stored on the hdd, from which the wrapped object can be reliably restored. (with a consistency check on the data)

Definition at line 1 of file CacheableObject.m.

List of all members.

Public Member Functions

 CacheableObject ( matfile, fieldname)
 constructor
function obj saveobj ()
 saves all fields except for the obj handle

Static Public Member Functions

static function this loadobj ( obj)
 restores the CacheableObject object and fills the obj handle again.

Public Attributes

 matfile
 the file name where the wrapped object is stored
 md5
 a hash computed from the cache file
 obj
 the pointer to the wrapped object
 matfile_path
 the full path to the file where the wrapped object is stored

Constructor & Destructor Documentation

CacheableObject.CacheableObject (   matfile,
  fieldname 
)

constructor

At construction time, the obj attribute is tried to be filled with the obj stored in matfile.

Parameters:
matfilea string specifying the full path or only the file name of the mat-file where the object is stored.
fieldnamea string specifying a fieldname that shall be passed as second argument to the load method. (Default: = [])

Definition at line 52 of file CacheableObject.m.


Member Function Documentation

function this = CacheableObject.loadobj (   obj) [static]

restores the CacheableObject object and fills the obj handle again.

Parameters:
objobj
Return values:
thisthis
Required fields of obj:
  • matfile_path —  matfile path
  • md5 —  md5

Definition at line 122 of file CacheableObject.m.

function obj = CacheableObject.saveobj ( )

saves all fields except for the obj handle

Return values:
objstruct to be stored in file
Generated fields of obj:
  • matfile_path —  matfile path
  • matfile —  matfile
  • md5 —  md5

Definition at line 101 of file CacheableObject.m.


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