pike.git / lib / modules / Cache.pmod / Storage.pmod / Memory.pike

version» Context lines:

pike.git/lib/modules/Cache.pmod/Storage.pmod/Memory.pike:1: - /* -  * A RAM-based storage manager. -  * by Francesco Chemolli <kinkie@roxen.com> -  * -  * $Id$ -  * -  * This storage manager provides the means to save data to memory. -  * In this manager I'll add reference documentation as comments to -  * interfaces. It will be organized later in a more comprehensive format -  * -  * Settings will be added later. -  */ + //! A RAM-based storage manager. + //! + //! This storage manager provides the means to save data to memory. + //! In this manager I'll add reference documentation as comments to + //! interfaces. It will be organized later in a more comprehensive format + //! + //! Settings will be added later. + //! + //! @thanks + //! Thanks to Francesco Chemolli <kinkie@@roxen.com> for the contribution.      #pike __REAL_VERSION__    -  + //!   class Data {       inherit Cache.Data;       int _size=0;    mixed _data=0;    multiset(string) _deps;       void create(void|mixed value, void|int abs_expire_time,    void|float preciousness,
pike.git/lib/modules/Cache.pmod/Storage.pmod/Memory.pike:88:    * I leave the data-object creation here, so that the storage manager    * can choose whatever data-class it pleases    */   void set(string key, mixed value,    void|int absolute_expire,    void|float preciousness,    void|multiset(string) dependants) {    data[key]=Data(value,absolute_expire,preciousness,dependants);   }    - // fetches some data from the cache. If notouch is set, don't touch the - // data from the cache (meant to be used by the storage manager only) + //! Fetches some data from the cache. If notouch is set, don't touch the + //! data from the cache (meant to be used by the storage manager only)   int(0..0)|Cache.Data get(string key, void|int notouch) {    mixed tmp;    tmp=data[key];    if (!notouch && tmp) tmp->touch();    return tmp;   }      void aget(string key,    function(string,int(0..0)|Cache.Data:void) callback) {    mixed rv=get(key);