v2.0.0
Loading...
Searching...
No Matches
mna_op_registry.h
Go to the documentation of this file.
1//=============================================================================================================
29
30#ifndef MNA_OP_REGISTRY_H
31#define MNA_OP_REGISTRY_H
32
33//=============================================================================================================
34// INCLUDES
35//=============================================================================================================
36
37#include "mna_global.h"
38#include "mna_op_schema.h"
39
40//=============================================================================================================
41// QT INCLUDES
42//=============================================================================================================
43
44#include <QString>
45#include <QStringList>
46#include <QMap>
47#include <QVariantMap>
48#include <functional>
49
50//=============================================================================================================
51// DEFINE NAMESPACE MNALIB
52//=============================================================================================================
53
54namespace MNALIB
55{
56
57//=============================================================================================================
65class MNASHARED_EXPORT MnaOpRegistry
66{
67public:
69 using OpFunc = std::function<QVariantMap(const QVariantMap& inputs,
70 const QVariantMap& attributes)>;
71
77 static MnaOpRegistry& instance();
78
84 void registerOp(const MnaOpSchema& schema);
85
93 bool hasOp(const QString& opType) const;
94
102 MnaOpSchema schema(const QString& opType) const;
103
109 QStringList registeredOps() const;
110
117 void registerOpFunc(const QString& opType, OpFunc func);
118
126 OpFunc opFunc(const QString& opType) const;
127
136 int loadRegistryFiles();
137
144 QStringList missingOps(const QStringList& pipelineTools) const;
145
146private:
147 MnaOpRegistry();
148
149 QMap<QString, MnaOpSchema> m_schemas;
150 QMap<QString, OpFunc> m_funcs;
151};
152
153} // namespace MNALIB
154
155#endif // MNA_OP_REGISTRY_H
Declarative contract for an MNA operation — expected input/output ports, attributes,...
Export/import macros, build-info accessors, and MNALIB namespace anchor for the MNE Analysis Containe...
#define MNASHARED_EXPORT
Definition mna_global.h:47
MNE Analysis Container Format (mna/mnx).
static MnaOpRegistry & instance()
OpFunc opFunc(const QString &opType) const
QStringList registeredOps() const
bool hasOp(const QString &opType) const
void registerOpFunc(const QString &opType, OpFunc func)
void registerOp(const MnaOpSchema &schema)
MnaOpSchema schema(const QString &opType) const
QStringList missingOps(const QStringList &pipelineTools) const
std::function< QVariantMap(const QVariantMap &inputs, const QVariantMap &attributes)> OpFunc
Operation implementation callback type.
Operation schema for graph validation.