SourcePro® 2022.1 |
SourcePro® API Reference Guide |
In memory metadata cache manager. More...
#include <rw/db/memcache.h>
Public Types | |
enum | RemovalType { table, storedProc, both } |
Public Member Functions | |
RWDBInMemoryCacheManager () | |
~RWDBInMemoryCacheManager () | |
RWDBStoredProcEntry | getStoredProc (const RWCString &key) const |
RWDBTableEntry | getTable (const RWCString &key) const |
void | removeAll (RemovalType t=both) |
void | setStoredProc (const RWCString &key, const RWDBStoredProcEntry &entry) |
void | setTable (const RWCString &key, const RWDBTableEntry &entry) |
Public Member Functions inherited from RWDBCacheManager | |
virtual | ~RWDBCacheManager () |
Friends | |
RWFile & | operator<< (RWFile &file, const RWDBInMemoryCacheManager &cm) |
RWvostream & | operator<< (RWvostream &strm, const RWDBInMemoryCacheManager &cm) |
RWFile & | operator>> (RWFile &file, RWDBInMemoryCacheManager &cm) |
RWvistream & | operator>> (RWvistream &strm, RWDBInMemoryCacheManager &cm) |
Additional Inherited Members | |
Protected Member Functions inherited from RWDBCacheManager | |
RWDBCacheManager () | |
RWDBCacheManager (const RWDBCacheManager &) | |
RWDBInMemoryCacheManager is an in-memory implementation for caching of schema metadata.
Install an instance of RWDBInMemoryCacheManager in an instance of RWDBDatabase. The metadata of the objects produced by that RWDBDatabase instance will be cached. An RWDBInMemoryCacheManager instance may not be shared amongst multiple RWDBDatabase objects. If you need to access the currently installed cache manager, acquire the lock to the RWDBDatabase and then release it when done via the methods RWDBDatabase::acquire() and RWDBDatabase::release(). The cache manager must remain in scope for the lifetime of the RWDBDatabase instance in which it is installed.
Please refer to the DB Interface Module User's Guide and the applicable DB Access Module User's Guide for more information on caching metadata.
Types allowed for removeAll().
|
inline |
Constructor.
RWDBInMemoryCacheManager::~RWDBInMemoryCacheManager | ( | ) |
Destructor.
|
virtual |
This method is called whenever we need any stored procedure metadata from the cache. If the key is not in the cache, this method returns an empty RWDBStoredProcEntry. The key is the return value of RWDBStoredProc::name().
The default implementation returns an empty RWDBStoredProcEntry.
Reimplemented from RWDBCacheManager.
|
virtual |
This method is called whenever we need any table metadata from the cache. If the key is not in the cache, this method returns an empty RWDBTableEntry. The key is the return value of RWDBTable::name().
The default implementation returns an empty RWDBTableEntry.
Reimplemented from RWDBCacheManager.
void RWDBInMemoryCacheManager::removeAll | ( | RemovalType | t = both | ) |
Clears all entries from the cache of type t.
|
virtual |
This method is called whenever we have fetched any stored procedure metadata from the database and need to cache it. The key is the return value of RWDBStoredProc::name(), and the spEntry contains all stored procedure metadata.
The default implementation is a no-op.
Reimplemented from RWDBCacheManager.
|
virtual |
This method is called whenever we have fetched any table metadata from the database and need to cache it. The key is the return value of RWDBTable::name(), and the tableEntry contains all table metadata.
The default implementation is a no-op.
Reimplemented from RWDBCacheManager.
|
friend |
Saves the object cm to an RWFile.
|
friend |
Saves the object cm to a virtual stream.
|
friend |
Restores an RWDBInMemoryCacheManager into cm from an RWFile, replacing the previous contents of cm.
|
friend |
Restores an RWDBInMemoryCacheManager into cm from a virtual stream, replacing the previous contents of cm.
Copyright © 2022 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |