• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

soprano

Soprano::Util::SignalCacheModel

Soprano::Util::SignalCacheModel Class Reference

#include <Soprano/Util/SignalCacheModel>

Inheritance diagram for Soprano::Util::SignalCacheModel:

Inheritance graph
[legend]

List of all members.


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@kde.org>
Since:
2.1

Definition at line 52 of file signalcachemodel.h.


Public Slots

void setCacheTime (int msec)

Public Member Functions

int cacheTime () const
 SignalCacheModel (Model *parent=0)
virtual ~SignalCacheModel ()

Protected Member Functions

virtual void parentStatementsAdded ()
virtual void parentStatementsRemoved ()
void timerEvent (QTimerEvent *event)

Constructor & Destructor Documentation

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

Create a new SignalCacheModel.

Parameters:
parent The 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

virtual void Soprano::Util::SignalCacheModel::parentStatementsAdded (  )  [protected, virtual]

Reimplemented to do the actual signal caching.

Reimplemented from Soprano::FilterModel.

virtual void Soprano::Util::SignalCacheModel::parentStatementsRemoved (  )  [protected, virtual]

Reimplemented to do the actual signal caching.

Reimplemented from Soprano::FilterModel.

void Soprano::Util::SignalCacheModel::setCacheTime ( int  msec  )  [slot]

Signals are only delivered once every msec milliseconds.

Default value is 50

void Soprano::Util::SignalCacheModel::timerEvent ( QTimerEvent *  event  )  [protected]

Reimplemented from QObject.


The documentation for this class was generated from the following file:
  • signalcachemodel.h

soprano

Skip menu "soprano"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • akonadi
  • Decibel
  • eigen
  • Eigen2
  • kdewin32
  • Phonon
  •     Backend
  • qca
  • qimageblitz
  • soprano
  • strigi
  •     searchclient
  •     streamanalyzer
  •     streams
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal