Soprano
2.9.4
|
Protect a Model for multiple calls in multi-threaded applications. More...
#include <Soprano/Util/MutexModel>
Public Types | |
enum | ProtectionMode { PlainMultiThreading, ReadWriteMultiThreading, ReadWriteSingleThreading } |
Public Member Functions | |
MutexModel (ProtectionMode mode, Model *parent=0) | |
~MutexModel () | |
Error::ErrorCode | addStatement (const Statement &statement) |
Error::ErrorCode | removeStatement (const Statement &statement) |
Error::ErrorCode | removeAllStatements (const Statement &statement) |
StatementIterator | listStatements (const Statement &partial) const |
NodeIterator | listContexts () const |
QueryResultIterator | executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const |
bool | containsStatement (const Statement &statement) const |
bool | containsAnyStatement (const Statement &statement) const |
bool | isEmpty () const |
int | statementCount () const |
![]() | |
virtual | ~FilterModel () |
virtual void | setParentModel (Model *model) |
virtual Model * | parentModel () const |
Error::ErrorCode | addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
StatementIterator | listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
bool | containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
bool | containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
virtual Error::ErrorCode | write (QTextStream &os) const |
virtual Node | createBlankNode () |
![]() | |
virtual | ~Model () |
Error::ErrorCode | addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | addStatements (const QList< Statement > &statements) |
Error::ErrorCode | removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) |
Error::ErrorCode | removeStatements (const QList< Statement > &statements) |
Error::ErrorCode | removeContext (const Node &) |
Error::ErrorCode | removeAllStatements () |
StatementIterator | listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
StatementIterator | listStatements () const |
StatementIterator | listStatementsInContext (const Node &context) const |
bool | containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
bool | containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const |
bool | containsContext (const Node &context) const |
![]() | |
QObject (QObject *parent=0) | |
blockSignals (bool block) | |
childEvent (QChildEvent *event) | |
children () | |
connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection) | |
connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoCompatConnection) | |
connectNotify (const char *signal) | |
customEvent (QEvent *event) | |
deleteLater () | |
destroyed (QObject *obj=0) | |
disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) | |
disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0) | |
disconnect (const QObject *receiver, const char *method=0) | |
disconnectNotify (const char *signal) | |
dumpObjectInfo () | |
dumpObjectTree () | |
dynamicPropertyNames () | |
event (QEvent *e) | |
eventFilter (QObject *watched, QEvent *event) | |
findChild (const QString &name=QString() | |
findChildren (const QString &name=QString() | |
findChildren (const QRegExp ®Exp) | |
inherits (const char *className) | |
installEventFilter (QObject *filterObj) | |
isWidgetType () | |
killTimer (int id) | |
metaObject () | |
moveToThread (QThread *targetThread) | |
parent () | |
property (const char *name) | |
receivers (const char *signal) | |
removeEventFilter (QObject *obj) | |
sender () | |
setParent (QObject *parent) | |
setProperty (const char *name, const QVariant &value) | |
signalsBlocked () | |
startTimer (int interval) | |
thread () | |
timerEvent (QTimerEvent *event) | |
tr (const char *sourceText, const char *comment=0, int n=-1) | |
trUtf8 (const char *sourceText, const char *comment=0, int n=-1) | |
staticMetaObject | |
QObject (QObject *parent, const char *name) | |
checkConnectArgs (const char *signal, const QObject *object, const char *method) | |
child (const char *objName, const char *inheritsClass=0, bool recursiveSearch=true) | |
className () | |
insertChild (QObject *object) | |
isA (const char *className) | |
name () | |
name (const char *defaultName) | |
normalizeSignalSlot (const char *signalSlot) | |
removeChild (QObject *object) | |
setName (const char *name) | |
![]() | |
virtual | ~ErrorCache () |
virtual Error | lastError () const |
Additional Inherited Members | |
![]() | |
void | statementsAdded () |
void | statementsRemoved () |
void | statementAdded (const Soprano::Statement &statement) |
void | statementRemoved (const Soprano::Statement &statement) |
![]() | |
FilterModel () | |
FilterModel (Model *parent) | |
virtual void | parentStatementsAdded () |
virtual void | parentStatementsRemoved () |
virtual void | parentStatementAdded (const Statement &) |
virtual void | parentStatementRemoved (const Statement &) |
Protect a Model for multiple calls in multi-threaded applications.
In most cases one does not need to use this FilterModel since Models created by Soprano::createModel and Soprano::Backend::createModel are thread-safe. It may, however, come in handy for custom models.
Definition at line 44 of file mutexmodel.h.
Enumerator | |
---|---|
PlainMultiThreading |
In PlainMultiThreading mode only one action can be performed at the same time. Calls block until the previous call is done.
|
ReadWriteMultiThreading |
In ReadWriteMultiThreading mode multiple read operations can be performed at the same time but only one write operation. In general write operations take precedence over read operations when locking. However, the same thread can perform nested read locks an arbitrary number of times. |
ReadWriteSingleThreading |
|
Definition at line 49 of file mutexmodel.h.
Soprano::Util::MutexModel::MutexModel | ( | ProtectionMode | mode, |
Model * | parent = 0 |
||
) |
Create a new MutexModel.
mode | The mode to use. |
parent | The parent Model to forward the actual calls to. |
Soprano::Util::MutexModel::~MutexModel | ( | ) |
Destructor.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model. Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.
|
virtual |
Default implementation simply pipes the call through to the parent model.
Reimplemented from Soprano::FilterModel.