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

Classical GoF observer pattern (Subject + IObserver) used by MNE-CPP's non-QObject model classes. More...

#include "../utils_global.h"
#include <set>
#include <QSet>
#include <QSharedPointer>
Include dependency graph for observerpattern.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UTILSLIB::IObserver
 The IObserver interface provides the base class of every observer of the observer design pattern. More...
class  UTILSLIB::Subject
 The Subject class provides the base class of every subject of the observer design pattern. More...

Namespaces

namespace  UTILSLIB
 Shared utilities (I/O helpers, spectral analysis, layout management, warp algorithms).

Detailed Description

Classical GoF observer pattern (Subject + IObserver) used by MNE-CPP's non-QObject model classes.

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

Author
Christoph Dinh chris.nosp@m.toph.nosp@m..dinh.nosp@m.@mne.nosp@m.-cpp..nosp@m.org; Lorenz Esch loren.nosp@m.z.es.nosp@m.ch@tu.nosp@m.-ilm.nosp@m.enau..nosp@m.de; Juan GPC jgarc.nosp@m.iapr.nosp@m.ieto@.nosp@m.mgh..nosp@m.harva.nosp@m.rd.e.nosp@m.du; Gabriel Motta gabri.nosp@m.elbe.nosp@m.nmott.nosp@m.a@gm.nosp@m.ail.c.nosp@m.om
Since
0.1.0
Date
September 2017

Qt's QObject signal/slot machinery is the preferred change notification mechanism, but a number of model classes in FIFFLIB, FSLIB and INVERSELIB are deliberately kept free of the moc dependency so they remain header-only or usable from static-library and WebAssembly builds. Those classes derive from UTILSLIB::Subject to publish change notifications to any number of UTILSLIB::IObserver listeners without dragging the QObject machinery in.

The static notifyEnabled flag exists so callers performing bulk updates (e.g. fitting a forward solution) can suspend notifications until the batch completes and prevent a storm of redundant repaints in connected views.

Definition in file observerpattern.h.