C++ (Qt)#include "object.h" Object::Object( QObject *parent ) : QObject( parent ), m_sigs( 5 ){ m_sigs[ 0 ] = &Object::sig0;
int CiControl::qt_metacall(QMetaObject::Call _c, int _id, void **_a){ _id = QObject::qt_metacall(_c, _id, _a); if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: localMenuEdit((*reinterpret_cast< QString(*)>(_a[1]))); break; case 1: localMenuDebug((*reinterpret_cast< QString(*)>(_a[1]))); break; case 2: localMenuRun((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< bool(*)>(_a[2]))); break; case 3: busyPlugin((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break; case 4: universalOut01((*reinterpret_cast< QVariant(*)>(_a[1]))); break; .....
typedef void ( *sox )( QVariant );class CiControl : public QObject{...private: sox sigarray[32];...signals: void universalOut01(QVariant);...}SEGINTERFACES* CiControl::getInterfaces(){... sigarray[0] = (sox) &CiControl::universalOut01;...}int CiControl::universalSend( unsigned int i, Qvariant container ){... emit sigarray[ i ]( container );...}
C++ (Qt)typedef void ( *sox )( QVariant );
C++ (Qt)sigarray[0] = (sox) &CiControl::universalOut01;
Код:class CiControl : public QObject{...private: typedef void (CiControl::*sox)( QVariant ); sox sigarray[32];...signals: void universalOut01(QVariant);...}SEGINTERFACES* CiControl::getInterfaces(){... sigarray[0] = &CiControl::universalOut01;...}int CiControl::universalSend( unsigned int i, QVariant container ){... emit (this->*sigarray[ i ])( container );...}
sigarray[0] = &CiControl::universalOut01; sigarray[1] = &CiControl::universalOut02; sigarray[2] = &CiControl::universalOut03; ......... ......... .........