Cache Class Reference

Whole cache manager class. More...

#include <Cache.h>

List of all members.

Public Member Functions

 Cache (const string &configurationDirectory) throw (Exception)
 Establishes cache.
virtual ~Cache ()
 Sweeps the cache.
void reloadConfig (const string &configurationDirectory)
 Reads config files and applies the changes safely.
Userlogin (const string &name)
 Returns a User reference or NULL if it has not been read from a configuration file.

Static Public Member Functions

static time_t getCurrentTime ()
 Returns actual time by using time() function from ctime.

Public Attributes

Settings config
 Current configuration read from file by Cache() or reloadConfig().
Logger logger
 Logger.
GarbageCollectorgc
 GarbageCollector reference.

Static Public Attributes

static const unsigned int MAX_OBJECT_SIZE = 1024 * 1024
 Size of the biggest value that can be stored.


Detailed Description

Whole cache manager class.

It responsible for reading the configuration from file system, creation of User objects and it is a User interface provider.

Definition at line 40 of file Cache.h.


Constructor & Destructor Documentation

Cache::Cache ( const string &  configurationDirectory  )  throw (Exception)

Establishes cache.

Reads config files and creates appropriate structure of config and users. Creates appropriate Allocator. Creates User objects read from configuration. Creates GarbageCollector object.

Parameters:
configurationDirectory configuration files directory
Exceptions:
FileNotFound When at least one of the given files does not exist.
ConfigParseException When file is malformed.
ConfigSemanticException When illegal value in file exists.

Definition at line 17 of file Cache.cpp.

Cache::~Cache (  )  [virtual]

Sweeps the cache.

See also:
Cache()

Definition at line 28 of file Cache.cpp.


Member Function Documentation

void Cache::reloadConfig ( const string &  configurationDirectory  ) 

Reads config files and applies the changes safely.

(the word safely is not fully supported yet)

Parameters:
configurationDirectory configuration files directory
Exceptions:
FileNotFound When at least one of the given files does not exist.
ConfigParseException When file is malformed.
ConfigSemanticException When illegal value in file exists.

Definition at line 38 of file Cache.cpp.

User * Cache::login ( const string &  name  ) 

Returns a User reference or NULL if it has not been read from a configuration file.

Parameters:
name User's login
Returns:
User reference or NULL

Definition at line 45 of file Cache.cpp.

static time_t Cache::getCurrentTime (  )  [inline, static]

Returns actual time by using time() function from ctime.

Returns:
timestamp of the actual time

Definition at line 119 of file Cache.h.


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

Generated on Fri Jan 8 10:38:13 2010 for dreamcache by  doxygen 1.5.5