The XCachedHash combines a templated QHash with a QObject that clears itself upon receipt of a specific database notification or set of notifications. More...
#include <xcachedhash.h>
Public Slots | |
virtual void | sConnectionLost () |
virtual void | sNotified (const QString &pNotification) |
Public Member Functions | |
virtual | ~XCachedHash () |
virtual const V | value (const K &key) |
Protected Member Functions | |
XCachedHash (QObject *pParent, const QStringList &pNotification, QSqlDatabase pDb=QSqlDatabase::database()) | |
XCachedHash (QObject *pParent=0, const QString &pNotification=QString(), QSqlDatabase pDb=QSqlDatabase::database()) | |
virtual void | clear () |
virtual bool | refresh (const K &key)=0 |
virtual void | setNotification (QStringList pNotification) |
Protected Attributes | |
QSqlDatabase | _db |
QStringList | _notice |
The XCachedHash combines a templated QHash with a QObject that clears itself upon receipt of a specific database notification or set of notifications.
This allows for straightforward access to a named object that's stored in the database, such as a script or metasql statement with minimal database access. The database is queried whenever a named object is not in the hash. The value retrieved from the database is stored in the hash and returned to the caller. The next time a caller requests that object, it is returned from the hash directly. The hash clears itself when the named database notification is received. Thus the next time a caller requests that named object, the hash requeries.
This is currently designed to be subclassed.
|
inlinevirtual |
|
inlineprotected |
|
inlineprotected |
|
inlineprotectedvirtual |
Implements XCachedHashQObject.
|
protectedpure virtual |
Implemented in MqlHash.
|
virtualslotinherited |
|
inlineprotectedvirtual |
|
virtualslotinherited |
|
inlinevirtual |
|
protected |
|
protectedinherited |
Generated on Mon Feb 17 2025 | xTuple ERP Programmer Reference, Version 6.2.0 |
|