Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
Sonde::anonymous_namespace{signaltrace.cpp}::SlotMetaObject Class Reference

A meta-object with one slot for each traced signal of a class, built at runtime. More...

Static Public Member Functions

static const QMetaObject * get (const QList< QByteArray > &names)
 The meta-object whose slots are named names, in order.

Private Member Functions

 SlotMetaObject (const QList< QByteArray > &names)
 Builds the tables for slots named names.

Private Attributes

std::vector< uint > m_strings
 moc's string table: offsets and sizes, then characters.
std::vector< uint > m_data
 moc's data table.
std::vector< const QtPrivate::QMetaTypeInterface * > m_metaTypes
 moc's metatype table.
QMetaObject m_meta { }
 The meta-object built from them.

Detailed Description

A meta-object with one slot for each traced signal of a class, built at runtime.

Each traced signal is connected to its own slot, so the method index that qt_metacall() receives says which signal fired, from any thread. The slots take no arguments: Qt accepts a slot with fewer arguments than its signal, and a direct connection still hands qt_metacall() the signal's own argv.

The tables are written in the layout moc generates, at revision 12 (Qt 6.8's moc). Later Qt versions must keep reading that revision, since applications built against 6.8 run on them. The technique is the one in Volker Krause's "DIY moc: Dynamic Meta Objects" (Qt Developer Days 2014).

Built meta-objects are kept for the life of the process: Qt 6.8 assumes a meta-object's strings stay where they are (only later versions know the AllocatedMetaObject flag), and QMetaMethod::name() points into them. They are shared by every handler with the same slot names, so there are few.


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