#include <composedCache.h>
Public Member Functions | |
virtual Cache * | clone () |
Creates a copy of the current cache. | |
Protected Member Functions | |
virtual void | setConnection (Connection *conn=NULL) |
Sets the connection associated with cache. | |
virtual void | clear () |
Synchronizes states of the cache and database. | |
virtual CacheLock & | makePersistent (const PersIdentification &persId, DatabaseObject &objectPtr) |
Saves an object into database. | |
virtual CacheLock & | getCacheLock (const PersIdentification &persId, bool rdonly=false) |
Assures an object is in cache, locks it and returns an instance making it possible to access the object. | |
virtual void | dbDelete (const PersIdentification &persId) |
Deletes an object. | |
virtual void | cacheDelete (const PersIdentification &persId) |
Represents a hint for the cache to remove local copy of an object. | |
virtual void | updateDirty () |
Synchronize the state of cache and DB by updating the DB. | |
virtual void | removeAll () |
Synchronize the state of cache and DB by discarding all kept object (without modifications to DB). | |
Protected Attributes | |
CacheSelector * | cacheSel |
StrategySelector * | stratSel |
void iopc::ComposedCache::setConnection | ( | Connection * | conn = NULL |
) | [protected, virtual] |
Sets the connection associated with cache.
conn | The connection. |
Reimplemented from iopc::Cache.
void iopc::ComposedCache::clear | ( | ) | [protected, virtual] |
Synchronizes states of the cache and database.
Removes all objects. Makes it possible to harmlessly break association of the cache and its connection.
Implements iopc::Cache.
CacheLock & iopc::ComposedCache::makePersistent | ( | const PersIdentification & | persId, | |
DatabaseObject & | objectPtr | |||
) | [protected, virtual] |
Saves an object into database.
Locks it in cache.
persId | ID of the object. | |
obj | Object to be made persistent. |
Implements iopc::Cache.
CacheLock & iopc::ComposedCache::getCacheLock | ( | const PersIdentification & | persId, | |
bool | rdonly = false | |||
) | [protected, virtual] |
Assures an object is in cache, locks it and returns an instance making it possible to access the object.
persId | ID of the object. | |
rdonly | Indicates the type of required access to the object (read-only/write). |
Implements iopc::Cache.
void iopc::ComposedCache::dbDelete | ( | const PersIdentification & | persId | ) | [protected, virtual] |
void iopc::ComposedCache::cacheDelete | ( | const PersIdentification & | persId | ) | [protected, virtual] |
Represents a hint for the cache to remove local copy of an object.
Can be ignored.
persId | ID of the object. |
Implements iopc::Cache.
CacheSelector* iopc::ComposedCache::cacheSel [protected] |
Provides access to subcaches.
StrategySelector* iopc::ComposedCache::stratSel [protected] |
Provides access to strategy settings.