Per-component registry of COMLIB::Command schemas; receives COMLIB::RawCommand from the parser and dispatches matching Command instances.
More...
#include "../com_global.h"#include "command.h"#include "command_parser.h"#include <utils/generics/observerpattern.h>#include <QObject>#include <QJsonDocument>

Go to the source code of this file.
Classes | |
| class | COMLIB::CommandManager |
| Observer-side registry of Command schemas a subsystem accepts from the shared CommandParser. More... | |
Namespaces | |
| namespace | COMLIB |
Real-time client/server communication primitives for talking to mne_rt_server. | |
Per-component registry of COMLIB::Command schemas; receives COMLIB::RawCommand from the parser and dispatches matching Command instances.
SPDX-License-Identifier: BSD-3-Clause Copyright (c) 2026 MNE-CPP Authors
COMLIB::CommandManager is the receiver half of the observer pattern anchored at COMLIB::CommandParser. Each subsystem that understands a slice of the mne_rt_server vocabulary (acquisition control, source-estimation control, GUI plumbing, etc.) owns a CommandManager seeded with the Command schemas it accepts and attaches it to the shared CommandParser. When the parser fans an incoming RawCommand out, every manager checks its own map and silently ignores requests it does not own — there is no global dispatch table to keep in sync.
Schemas can be installed three different ways: explicitly by name and description via insert(QString, QString), one at a time by handing over a fully-formed Command via insert(QString, Command) (the manager re-parents the Command so its lifetime tracks the manager), or in bulk by loading a QJsonDocument that describes a whole command set in the same JSON layout the server itself emits when a client asks for its command list. The CTOR overload that takes a QByteArray/ the convenience entry point for that bulk path.QJsonDocument is
Outbound traffic uses three signals. commandMapChanged() notifies the rest of the application when the schema set has been mutated. triggered(Command) lets the manager push outbound requests onto the shared RtCmdClient. response(QString, Command) carries the reply produced by an executed Command back to whoever originally sent it. m_bIsActive lets a subsystem temporarily mute the manager (during long-running operations, for example) without detaching it from the parser.
Definition in file command_manager.h.