Soprano  2.8.0
Public Slots | Public Member Functions | Protected Member Functions | List of all members
Soprano::Util::SignalCacheModel Class Reference

Caches multiple signals into one to avoid slowdown when adding or removing many statements. More...

#include <Soprano/Util/SignalCacheModel>

+ Inheritance diagram for Soprano::Util::SignalCacheModel:

Public Slots

void setCacheTime (int msec)

Public Member Functions

 SignalCacheModel (Model *parent=0)
virtual ~SignalCacheModel ()
int cacheTime () const
- Public Member Functions inherited from Soprano::FilterModel
virtual ~FilterModel ()
virtual void setParentModel (Model *model)
virtual ModelparentModel () const
virtual Error::ErrorCode addStatement (const Statement &statement)
Error::ErrorCode addStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
virtual Error::ErrorCode removeStatement (const Statement &statement)
Error::ErrorCode removeStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
virtual Error::ErrorCode removeAllStatements (const Statement &statement)
Error::ErrorCode removeAllStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
virtual StatementIterator listStatements (const Statement &partial) const
StatementIterator listStatements (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
virtual NodeIterator listContexts () const
virtual QueryResultIterator executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
virtual bool containsStatement (const Statement &statement) const
bool containsStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
virtual bool containsAnyStatement (const Statement &statement) const
bool containsAnyStatement (const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
virtual bool isEmpty () const
virtual int statementCount () const
virtual Error::ErrorCode write (QTextStream &os) const
virtual Node createBlankNode ()
- Public Member Functions inherited from Soprano::Model
virtual ~Model ()
Error::ErrorCode addStatements (const QList< Statement > &statements)
Error::ErrorCode removeStatements (const QList< Statement > &statements)
Error::ErrorCode removeContext (const Node &)
Error::ErrorCode removeAllStatements ()
StatementIterator listStatements () const
StatementIterator listStatementsInContext (const Node &context) const
bool containsContext (const Node &context) const
- Public Member Functions inherited from QObject
 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 &regExp)
 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 ()
 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)
- Public Member Functions inherited from Soprano::Error::ErrorCache
virtual ~ErrorCache ()
virtual Error lastError () const

Protected Member Functions

virtual void parentStatementsAdded ()
virtual void parentStatementsRemoved ()
void timerEvent (QTimerEvent *event)
- Protected Member Functions inherited from Soprano::FilterModel
 FilterModel ()
 FilterModel (Model *parent)
virtual void parentStatementAdded (const Statement &)
virtual void parentStatementRemoved (const Statement &)
- Protected Member Functions inherited from Soprano::Model
 Model ()
- Protected Member Functions inherited from Soprano::Error::ErrorCache
 ErrorCache ()
void clearError () const
void setError (const Error &) const
void setError (const QString &errorMessage, int code=ErrorUnknown) const

Additional Inherited Members

- Signals inherited from Soprano::Model
void statementsAdded ()
void statementsRemoved ()
void statementAdded (const Soprano::Statement &statement)
void statementRemoved (const Soprano::Statement &statement)

Detailed Description

Caches multiple signals into one to avoid slowdown when adding or removing many statements.

When adding or removing many statements with separate calls to Model::addStatement or Model::removeStatement Model emits signals Model::statementsAdded and Model::statementsRemoved over and over for each call. This can slow down an application that monitors the state of the model.

The SignalCacheModel caches multiple emitted signals into one, trying to ensure that only one signal is delivered in a certain time. The downside of this is that signals are not delivered immiadetely but through the event loop. This, however, should seldomly be a problem.

Author
Sebastian Trueg trueg.nosp@m.@kde.nosp@m..org
Since
2.1

Definition at line 52 of file signalcachemodel.h.

Constructor & Destructor Documentation

Soprano::Util::SignalCacheModel::SignalCacheModel ( Model parent = 0)

Create a new SignalCacheModel.

Parameters
parentThe parent Model to forward the actual calls to.
virtual Soprano::Util::SignalCacheModel::~SignalCacheModel ( )
virtual

Destructor.

Member Function Documentation

int Soprano::Util::SignalCacheModel::cacheTime ( ) const

The cache time.

See Also
setCacheTime
void Soprano::Util::SignalCacheModel::setCacheTime ( int  msec)
slot

Signals are only delivered once every msec milliseconds.

Default value is 50

virtual void Soprano::Util::SignalCacheModel::parentStatementsAdded ( )
protectedvirtual

Reimplemented to do the actual signal caching.

Reimplemented from Soprano::FilterModel.

virtual void Soprano::Util::SignalCacheModel::parentStatementsRemoved ( )
protectedvirtual

Reimplemented to do the actual signal caching.

Reimplemented from Soprano::FilterModel.

void Soprano::Util::SignalCacheModel::timerEvent ( QTimerEvent event)
protected

Reimplemented from QObject.


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