\name{ObjectStore} \alias{ObjectStore} \title{An Object store} \description{Store/retrieve object by \code{key}, is \code{dir} is not \code{NULL} objects are also saved in a file called \code{key} under the directory \code{dir}. ObjectStore(dir) allow to create a static Object store getObj(key) allow to retrieve an object indexed by \code{key}. If \code{dir} was not \code{NULL} and if the object is not found, then ObjectStore look for a file \code{key} in directory \code{dir}, if it exists the object is loaded from the file and returned storeObj(key,obj) allow to store an object indexed by \code{key}. If \code{dir} was not \code{NULL} then is also stored in a file \code{key} in directory \code{dir}. } \usage{ # Build object static ObjectStore(dir) static getObj(key,disk=TRUE) static storeObj(key,obj,disk=TRUE) } \arguments{ \item{dir}{A directory, if not null object will be stored/retriveved in this directory} \item{disk}{If \code{FALSE} do not try to retrive/store from/on disk} } \value{ } \seealso{ } \examples{ ObjectStore(dir='.') setConstructorS3("O",function(x=NULL)extend(Object(),'O',x=x)) o1=O(1:1000000) ObjectStore$storeObj('o1',o1) ObjectStore$getObj('o1') ## Restart R ObjectStore(dir='.') o1=ObjectStore$getObj('o1') }