Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
signaltools.cpp File Reference

The signal_watch / signal_unwatch tools: signal emissions as events. More...

#include "server_p.h"
#include "signalcapture_p.h"
#include <sonde/eventsource.h>
#include <sonde/introspectiontools.h>
#include <sonde/objecttree.h>
#include <sonde/schema.h>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <QtCore/QMap>
#include <QtCore/QMetaMethod>
#include <QtCore/QPointer>
#include <QtCore/QThread>

Classes

class  Sonde::anonymous_namespace{signaltools.cpp}::SignalWatcher
 Turns each emission of one signal of one object into an event. More...
struct  Sonde::anonymous_namespace{signaltools.cpp}::Watches
 The active watches: an id each, and one watcher per watched overload. More...

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.
namespace  Sonde::SignalCapture
 Capturing the arguments of a signal emission.

Functions

QVariantList Sonde::SignalCapture::arguments (const QMetaMethod &signal, void *const *argv)
 Copies the arguments of an emission of signal, which are argv[1..n].
QJsonArray Sonde::SignalCapture::toJson (const QVariantList &args, QStringList *texts)
 Converts what arguments() captured to JSON; texts receives each one as text.
bool & Sonde::SignalCapture::recording ()
 Set while this thread records an emission, so the signals that recording emits (the event machinery's own) aren't recorded in turn.
constexpr QLatin1StringView Sonde::anonymous_namespace{signaltools.cpp}::kSourceName ("signals")
 Name of the event source the emissions go to.
bool Sonde::anonymous_namespace{signaltools.cpp}::isClone (const QMetaMethod &m)
 Whether m is a copy moc made for a default argument.
QList< QMetaMethod > Sonde::anonymous_namespace{signaltools.cpp}::matchingSignals (const QMetaObject *mo, const QString &name)
 The signals of mo named name, or with exactly that signature if name contains '('.
QString Sonde::anonymous_namespace{signaltools.cpp}::signalNames (const QMetaObject *mo)
 The signal names of mo, for error messages.
ToolResult Sonde::anonymous_namespace{signaltools.cpp}::signalWatch (Server &server, const std::shared_ptr< Watches > &watches, const QJsonObject &args)
 The signal_watch tool.
ToolResult Sonde::anonymous_namespace{signaltools.cpp}::signalUnwatch (const std::shared_ptr< Watches > &watches, const QJsonObject &args)
 The signal_unwatch tool.
void Sonde::installSignalTools (Server &server)
 Registers signal_watch and signal_unwatch on server, and adds the "signals" event source they report to.

Variables

constexpr int Sonde::anonymous_namespace{signaltools.cpp}::kMaxWatches = 64
 Most watches that can be active at once.

Detailed Description

The signal_watch / signal_unwatch tools: signal emissions as events.

Also the argument capture they share with signal_trace_start (signaltrace.cpp).