Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

KDChart::SignalCompressor Class Reference

#include <KDChartSignalCompressor.h>

Inheritance diagram for KDChart::SignalCompressor:

[legend]
Collaboration diagram for KDChart::SignalCompressor:
[legend]
List of all members.

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 29 of file KDChartSignalCompressor.h.

Public Member Functions

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

Public Attributes

Q_SIGNALS __pad0__: void finallyEmit()
private Q_SLOTS: void nowGoAlready()
public Q_SLOTS: void emitSignal()


Constructor & Destructor Documentation

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

Definition at line 5 of file KDChartSignalCompressor.cpp.

00007     : QObject( parent )
00008 {
00009     connect( this, SIGNAL( finallyEmit() ), receiver, signal );
00010     connect( &m_timer, SIGNAL( timeout() ), SLOT( nowGoAlready() ) );
00011     m_timer.setSingleShot( true );
00012     // m_timer.setIntervall( 0 ); // default, just to know...
00013 }


Member Data Documentation

Q_SIGNALS KDChart::SignalCompressor::__pad0__
 

Definition at line 38 of file KDChartSignalCompressor.h.

private KDChart::SignalCompressor::Q_SLOTS
 

Definition at line 44 of file KDChartSignalCompressor.h.

public KDChart::SignalCompressor::Q_SLOTS
 

Definition at line 41 of file KDChartSignalCompressor.h.


The documentation for this class was generated from the following files:
Generated on Thu May 10 11:06:34 2007 for KD Chart 2 by doxygen 1.3.6