iopc::Cache Class Reference
[iopclib-cache]

Object cache interface. More...

#include <cache.h>

Inheritance diagram for iopc::Cache:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void setConnection (Connection *conn=NULL)
 Sets the connection associated with cache.
virtual void clear ()=0
 Synchronizes states of the cache and database.
virtual CacheLockmakePersistent (const PersIdentification &persId, DatabaseObject &objectPtr)=0
 Saves an object into database.
virtual CacheLockgetCacheLock (const PersIdentification &persId, bool rdonly=false)=0
 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)=0
 Deletes an object.
virtual void cacheDelete (const PersIdentification &persId)=0
 Represents a hint for the cache to remove local copy of an object.
virtual void updateDirty ()=0
 Synchronize the state of cache and DB by updating the DB.
virtual void removeAll ()=0
 Synchronize the state of cache and DB by discarding all kept object (without modifications to DB).
virtual Cacheclone ()=0
 Creates a copy of the current cache.

Protected Attributes

Connectionconn


Detailed Description

Object cache interface.

Member Function Documentation

void iopc::Cache::setConnection ( Connection conn = NULL  )  [inline, virtual]

Sets the connection associated with cache.

Parameters:
conn The connection.

Reimplemented in iopc::ComposedCache, and iopc::FakeExtendedCache.

virtual void iopc::Cache::clear (  )  [pure virtual]

Synchronizes states of the cache and database.

Removes all objects. Makes it possible to harmlessly break association of the cache and its connection.

Implemented in iopc::ComposedCache, iopc::ExtendedCache, iopc::FakeExtendedCache, and iopc::VoidCache.

virtual CacheLock& iopc::Cache::makePersistent ( const PersIdentification persId,
DatabaseObject objectPtr 
) [pure virtual]

Saves an object into database.

Locks it in cache.

Parameters:
persId ID of the object.
obj Object to be made persistent.
Returns:
An instance representing locked object and making it possible to read and modify the object.

Implemented in iopc::ComposedCache, iopc::ExtendedCache, and iopc::VoidCache.

virtual CacheLock& iopc::Cache::getCacheLock ( const PersIdentification persId,
bool  rdonly = false 
) [pure virtual]

Assures an object is in cache, locks it and returns an instance making it possible to access the object.

Parameters:
persId ID of the object.
rdonly Indicates the type of required access to the object (read-only/write).
Returns:
An instance making it possible to access the object.

Implemented in iopc::ComposedCache, iopc::ExtendedCache, and iopc::VoidCache.

virtual void iopc::Cache::dbDelete ( const PersIdentification persId  )  [pure virtual]

Deletes an object.

Parameters:
persId ID of the object.

Implemented in iopc::ComposedCache, iopc::ExtendedCache, iopc::FakeExtendedCache, and iopc::VoidCache.

virtual void iopc::Cache::cacheDelete ( const PersIdentification persId  )  [pure virtual]

Represents a hint for the cache to remove local copy of an object.

Can be ignored.

Parameters:
persId ID of the object.

Implemented in iopc::ComposedCache, iopc::ExtendedCache, iopc::FakeExtendedCache, and iopc::VoidCache.


Member Data Documentation

A connection associated with the cache.


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

Generated on Tue Apr 14 16:46:43 2009 for IOPC 2 by  doxygen 1.5.6