v2.0.0
Loading...
Searching...
No Matches
mna_op_registry.h
Go to the documentation of this file.
1//=============================================================================================================
34
35#ifndef MNA_OP_REGISTRY_H
36#define MNA_OP_REGISTRY_H
37
38//=============================================================================================================
39// INCLUDES
40//=============================================================================================================
41
42#include "mna_global.h"
43#include "mna_op_schema.h"
44
45//=============================================================================================================
46// QT INCLUDES
47//=============================================================================================================
48
49#include <QString>
50#include <QStringList>
51#include <QMap>
52#include <QVariantMap>
53#include <functional>
54
55//=============================================================================================================
56// DEFINE NAMESPACE MNALIB
57//=============================================================================================================
58
59namespace MNALIB
60{
61
62//=============================================================================================================
68class MNASHARED_EXPORT MnaOpRegistry
69{
70public:
72 using OpFunc = std::function<QVariantMap(const QVariantMap& inputs,
73 const QVariantMap& attributes)>;
74
78 static MnaOpRegistry& instance();
79
83 void registerOp(const MnaOpSchema& schema);
84
88 bool hasOp(const QString& opType) const;
89
93 MnaOpSchema schema(const QString& opType) const;
94
98 QStringList registeredOps() const;
99
103 void registerOpFunc(const QString& opType, OpFunc func);
104
108 OpFunc opFunc(const QString& opType) const;
109
118 int loadRegistryFiles();
119
126 QStringList missingOps(const QStringList& pipelineTools) const;
127
128private:
129 MnaOpRegistry();
130
131 QMap<QString, MnaOpSchema> m_schemas;
132 QMap<QString, OpFunc> m_funcs;
133};
134
135} // namespace MNALIB
136
137#endif // MNA_OP_REGISTRY_H
mna library export/import macros.
#define MNASHARED_EXPORT
Definition mna_global.h:55
MnaOpSchema class declaration — contract for graph operations.
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.