KDChart::SignalCompressor Class Reference

SignalCompressor compresses signals where the same signal needs to be emitted by several pieces of the code, but only one of the signals should be received at the end. More...

#include <KDChartSignalCompressor.h>

Inheritance diagram for KDChart::SignalCompressor:
Inheritance graph
[legend]
Collaboration diagram for KDChart::SignalCompressor:
Collaboration graph
[legend]

List of all members.

Public Slots

void emitSignal ()

Signals

void finallyEmit ()

Public Member Functions

 SignalCompressor (QObject *receiver, const char *signal, QObject *parent=0)

Detailed Description

SignalCompressor compresses signals where the same signal needs to be emitted by several pieces of the code, but only one of the signals should be received at the end.

Usage: create a object of SignalCompressor, and give it the name and object of the signal it is supposed to manage instead of emitting the signal, call emitSignal() on the compressor the signal will only be emitted once, and that is after the current call stack ends and returns to the event loop

With the current implementation, the class changes the sematics of signals to be a queued connection. If that is not wanted, another compression algorithm needs to be implemented. Also, at the moment, only nullary signals are supported, as parameters could not be compressed. A typical use of the class is to compress update notifications. This class is not part of the published KDChart API.

Definition at line 51 of file KDChartSignalCompressor.h.


Constructor & Destructor Documentation

SignalCompressor::SignalCompressor ( QObject receiver,
const char *  signal,
QObject parent = 0 
)

Definition at line 27 of file KDChartSignalCompressor.cpp.

References finallyEmit().


Member Function Documentation

void SignalCompressor::emitSignal (  )  [slot]

Definition at line 37 of file KDChartSignalCompressor.cpp.

void KDChart::SignalCompressor::finallyEmit (  )  [signal]

Referenced by SignalCompressor().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines

Klarälvdalens Datakonsult AB (KDAB)
Qt-related services and products
http://www.kdab.com/
http://www.kdab.com/products/kd-chart/