Public Member Functions | Private Member Functions | Private Attributes

conan::SignalSpy Class Reference

The SignalSpy class enables introspection of signal emission. More...

#include <SignalSpy.h>

List of all members.

Public Member Functions

 SignalSpy (const QObject *inObject, const QString &inSignal, SignalLogger *inLogger)
 Creates a SignalSpy that outputs emissions of the given signal (normalized signature).
int qt_metacall (QMetaObject::Call inCall, int inMethodId, void **inArgs)
 Called whenever a signal emission occurs.
const MethodDataSignalData () const
 Returns information about the signal being spied.
int EmitCount () const
 Returns the number of monitored emissions for the signal.

Private Member Functions

void InitArgs (const QMetaMethod &inMember)
 Stores the argument types for the signal being monitored.
void ProcessArgs (void **inArgs)
 Processes the arguments of a signal emission and outputs information about that signal emission.

Private Attributes

SignalLoggermLogger
 Performs the actual logging of each signal emission.
QList< int > mArgTypes
 The QMetaType types for the argument list of the signal.
MethodData mSignalData
 Information about the signal being spied.
unsigned mEmitCount
 The number of times the signal has been emitted.

Detailed Description

The SignalSpy class enables introspection of signal emission.

SignalSpy can connect to any signal of any object and output each emission using qDebug. Note that this class is an adaptation of the existing QSignalSpy class.


Constructor & Destructor Documentation

conan::SignalSpy::SignalSpy ( const QObject *  inObject,
const QString &  inSignal,
SignalLogger inLogger 
)

Creates a SignalSpy that outputs emissions of the given signal (normalized signature).

All actual logging is delegated to the given logger.


Member Function Documentation

int conan::SignalSpy::EmitCount (  )  const

Returns the number of monitored emissions for the signal.

void conan::SignalSpy::InitArgs ( const QMetaMethod &  inMember  )  [private]

Stores the argument types for the signal being monitored.

void conan::SignalSpy::ProcessArgs ( void **  inArgs  )  [private]

Processes the arguments of a signal emission and outputs information about that signal emission.

int conan::SignalSpy::qt_metacall ( QMetaObject::Call  inCall,
int  inMethodId,
void **  inArgs 
)

Called whenever a signal emission occurs.

const MethodData & conan::SignalSpy::SignalData (  )  const

Returns information about the signal being spied.


Member Data Documentation

QList<int> conan::SignalSpy::mArgTypes [private]

The QMetaType types for the argument list of the signal.

unsigned conan::SignalSpy::mEmitCount [private]

The number of times the signal has been emitted.

Performs the actual logging of each signal emission.

Information about the signal being spied.


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