v2.0.0
Loading...
Searching...
No Matches
command.h File Reference

Typed, parameter-bearing command object that round-trips between mne-cpp clients and mne_rt_server. More...

#include "../com_global.h"
#include <utils/generics/commandpattern.h>
#include <QObject>
#include <QList>
#include <QString>
#include <QVariant>
#include <QJsonObject>
#include <QSharedPointer>
#include <QDebug>
#include <QPair>
#include <QStringList>
Include dependency graph for command.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  COMLIB::Command
 Named, parameterised command exchanged with mne_rt_server; supports both JSON and CLI serialisation. More...

Namespaces

namespace  COMLIB
 Real-time client/server communication primitives for talking to mne_rt_server.

Detailed Description

Typed, parameter-bearing command object that round-trips between mne-cpp clients and mne_rt_server.

SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org
Since
2.0.0
Date
March 2026

COMLIB::Command is the unit of conversation on the mne_rt_server control channel after parsing has assigned types (compare COMLIB::RawCommand, which carries only string tokens). Each instance holds a short command keyword (e.g. bufsize, selch, start), a human-readable description, a list of named parameters with both their QVariant values and their per-parameter descriptions, and a flag selecting JSON or CLI serialisation when the object is pushed out through RtCmdClient.

Two construction paths matter. The data path: an incoming JSON object is parsed into a fully-populated Command by the QJsonObject constructor, so the server’s self-described command list (returned by requestCommands()) can be replayed locally without hard-coding the schema. The authoring path: client code constructs an empty Command with name, description and parameter declarations, fills pValues() per call site, then forwards it to RtCmdClient::sendCommandJSON. toStringReadySend() and toJsonObject() / toStringList() format the same object for the different transports.

Command implements UTILSLIB::ICommand from the generic command pattern so it can be dispatched through CommandManager without the manager needing to know whether the receiver is local or remote; the triggered / received signals are how the manager routes execution back to subscribers.

Definition in file command.h.