46#include <QCoreApplication>
60MnaOpRegistry::MnaOpRegistry()
69 static MnaOpRegistry registry;
84 return m_schemas.contains(opType);
91 return m_schemas.value(opType);
98 return m_schemas.keys();
105 m_funcs.insert(opType, func);
112 return m_funcs.value(opType);
120 const QString relPath = QStringLiteral(
"resources/mna");
122 QDir dir(QCoreApplication::applicationDirPath());
123 for (
int i = 0; i < 6; ++i) {
124 QString candidate = dir.absoluteFilePath(relPath);
125 if (QDir(candidate).exists()) {
132 if (QDir(relPath).exists())
135 qWarning() <<
"MnaOpRegistry: Could not find resources/mna/ registry directory";
144 for (
const QString& tool : pipelineTools) {
145 if (!m_schemas.contains(tool))
146 missing.append(tool);
MnaOpRegistry class declaration — singleton catalog of operation schemas.
MnaRegistryLoader class declaration — loads MNA op schemas from JSON manifests.
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.
static int loadDirectory(const QString ®istryDir, MnaOpRegistry ®istry)