v2.0.0
Loading...
Searching...
No Matches
MNALIB::MnaOpRegistry Class Reference

Process-wide lookup from opType to MnaOpSchema and implementation function. More...

#include <mna_op_registry.h>

Public Types

using OpFunc
 Operation implementation callback type.

Public Member Functions

void registerOp (const MnaOpSchema &schema)
bool hasOp (const QString &opType) const
MnaOpSchema schema (const QString &opType) const
QStringList registeredOps () const
void registerOpFunc (const QString &opType, OpFunc func)
OpFunc opFunc (const QString &opType) const
int loadRegistryFiles ()
QStringList missingOps (const QStringList &pipelineTools) const

Static Public Member Functions

static MnaOpRegistry & instance ()

Detailed Description

Process-wide lookup from opType to MnaOpSchema and implementation function.

Singleton catalog of all registered operation schemas.

Definition at line 65 of file mna_op_registry.h.

Member Typedef Documentation

◆ OpFunc

Initial value:
std::function<QVariantMap(const QVariantMap& inputs,
const QVariantMap& attributes)>

Operation implementation callback type.

Definition at line 69 of file mna_op_registry.h.

Member Function Documentation

◆ hasOp()

bool MnaOpRegistry::hasOp ( const QString & opType) const

Check if an operation type is registered.

Parameters
[in]opTypeOperation type name to look up.
Returns
true if a schema is registered for opType, false otherwise.

Definition at line 73 of file mna_op_registry.cpp.

◆ instance()

MnaOpRegistry & MnaOpRegistry::instance ( )
static

Access the singleton instance.

Returns
Reference to the process-wide registry.

Definition at line 58 of file mna_op_registry.cpp.

◆ loadRegistryFiles()

int MnaOpRegistry::loadRegistryFiles ( )

Load registry files from the standard resources/mna/ directory.

Searches upward from the application directory to find resources/mna/, then loads mna-registry.json and all drop-in files from mna-registry.d/.

Returns
Number of ops loaded, or 0 if no registry directory was found.

Definition at line 108 of file mna_op_registry.cpp.

◆ missingOps()

QStringList MnaOpRegistry::missingOps ( const QStringList & pipelineTools) const

Return op types referenced in a project that have no registered schema.

Parameters
[in]pipelineToolsThe MNA project to check.
Returns
List of op type strings with no registered schema.

Definition at line 132 of file mna_op_registry.cpp.

◆ opFunc()

MnaOpRegistry::OpFunc MnaOpRegistry::opFunc ( const QString & opType) const

Get the implementation function for an operation type.

Parameters
[in]opTypeOperation type name to look up.
Returns
The registered callback, or an empty OpFunc if none is registered.

Definition at line 101 of file mna_op_registry.cpp.

◆ registeredOps()

QStringList MnaOpRegistry::registeredOps ( ) const

List all registered operation types.

Returns
Names of all operation types that have a registered schema.

Definition at line 87 of file mna_op_registry.cpp.

◆ registerOp()

void MnaOpRegistry::registerOp ( const MnaOpSchema & schema)

Register an operation schema.

Parameters
[in]schemaSchema to store; replaces any existing schema with the same opType.

Definition at line 66 of file mna_op_registry.cpp.

◆ registerOpFunc()

void MnaOpRegistry::registerOpFunc ( const QString & opType,
OpFunc func )

Register an implementation function for an operation type.

Parameters
[in]opTypeOperation type name the function implements.
[in]funcCallback mapping inputs and attributes to outputs; replaces any existing one.

Definition at line 94 of file mna_op_registry.cpp.

◆ schema()

MnaOpSchema MnaOpRegistry::schema ( const QString & opType) const

Get the schema for an operation type.

Parameters
[in]opTypeOperation type name to look up.
Returns
The registered schema, or a default-constructed schema if opType is unknown.

Definition at line 80 of file mna_op_registry.cpp.


The documentation for this class was generated from the following files: