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//=============================================================================================================
63class MNASHARED_EXPORT MnaOpRegistry
64{
65public:
67 using OpFunc = std::function<QVariantMap(const QVariantMap& inputs,
68 const QVariantMap& attributes)>;
69
73 static MnaOpRegistry& instance();
74
78 void registerOp(const MnaOpSchema& schema);
79
83 bool hasOp(const QString& opType) const;
84
88 MnaOpSchema schema(const QString& opType) const;
89
93 QStringList registeredOps() const;
94
98 void registerOpFunc(const QString& opType, OpFunc func);
99
103 OpFunc opFunc(const QString& opType) const;
104
113 int loadRegistryFiles();
114
121 QStringList missingOps(const QStringList& pipelineTools) const;
122
123private:
124 MnaOpRegistry();
125
126 QMap<QString, MnaOpSchema> m_schemas;
127 QMap<QString, OpFunc> m_funcs;
128};
129
130} // namespace MNALIB
131
132#endif // MNA_OP_REGISTRY_H
Export/import macros, build-info accessors, and MNALIB namespace anchor for the MNE Analysis Containe...
#define MNASHARED_EXPORT
Definition mna_global.h:47
Declarative contract for an MNA operation — expected input/output ports, attributes,...
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.