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

In-memory DAG of MnaNode operations with validation, topological sort and JSON/CBOR persistence. More...

#include <mna_graph.h>

Public Member Functions

 MnaGraph ()
void addNode (const MnaNode &node)
void removeNode (const QString &nodeId)
MnaNodenode (const QString &nodeId)
const MnaNodenode (const QString &nodeId) const
QList< MnaNode > & nodes ()
const QList< MnaNode > & nodes () const
bool hasNode (const QString &nodeId) const
bool connect (const QString &srcNodeId, const QString &srcPortName, const QString &dstNodeId, const QString &dstPortName)
bool validate (QStringList *errors=nullptr) const
QStringList topologicalSort () const
QStringList upstreamNodes (const QString &nodeId) const
QStringList downstreamNodes (const QString &nodeId) const
QStringList dirtyNodes () const
QJsonObject toJson () const
QCborMap toCbor () const

Static Public Member Functions

static MnaGraph fromJson (const QJsonObject &json)
static MnaGraph fromCbor (const QCborMap &cbor)

Public Attributes

QList< MnaPortgraphInputs
 Named, typed entry points.
QList< MnaPortgraphOutputs
 Named, typed exit points.
MnaParamTree paramTree
 Hierarchical parameter store with formula-driven bindings.

Detailed Description

In-memory DAG of MnaNode operations with validation, topological sort and JSON/CBOR persistence.

Directed acyclic graph of processing nodes forming a computational pipeline.

Definition at line 65 of file mna_graph.h.

Constructor & Destructor Documentation

◆ MnaGraph()

MnaGraph::MnaGraph ( )

Definition at line 52 of file mna_graph.cpp.

Member Function Documentation

◆ addNode()

void MnaGraph::addNode ( const MnaNode & node)

Definition at line 60 of file mna_graph.cpp.

◆ connect()

bool MnaGraph::connect ( const QString & srcNodeId,
const QString & srcPortName,
const QString & dstNodeId,
const QString & dstPortName )

Connect output port of srcNode to input port of dstNode. Sets the sourceNodeId and sourcePortName on the destination input port.

Returns
true if connection was made, false if ports not found.

Definition at line 133 of file mna_graph.cpp.

◆ dirtyNodes()

QStringList MnaGraph::dirtyNodes ( ) const

Definition at line 425 of file mna_graph.cpp.

◆ downstreamNodes()

QStringList MnaGraph::downstreamNodes ( const QString & nodeId) const

Definition at line 380 of file mna_graph.cpp.

◆ fromCbor()

MnaGraph MnaGraph::fromCbor ( const QCborMap & cbor)
static

Definition at line 539 of file mna_graph.cpp.

◆ fromJson()

MnaGraph MnaGraph::fromJson ( const QJsonObject & json)
static

Definition at line 480 of file mna_graph.cpp.

◆ hasNode()

bool MnaGraph::hasNode ( const QString & nodeId) const

Definition at line 119 of file mna_graph.cpp.

◆ node() [1/2]

MnaNode & MnaGraph::node ( const QString & nodeId)

Definition at line 79 of file mna_graph.cpp.

◆ node() [2/2]

const MnaNode & MnaGraph::node ( const QString & nodeId) const

Definition at line 92 of file mna_graph.cpp.

◆ nodes() [1/2]

QList< MnaNode > & MnaGraph::nodes ( )

Definition at line 105 of file mna_graph.cpp.

◆ nodes() [2/2]

const QList< MnaNode > & MnaGraph::nodes ( ) const

Definition at line 112 of file mna_graph.cpp.

◆ removeNode()

void MnaGraph::removeNode ( const QString & nodeId)

Definition at line 67 of file mna_graph.cpp.

◆ toCbor()

QCborMap MnaGraph::toCbor ( ) const

Definition at line 508 of file mna_graph.cpp.

◆ toJson()

QJsonObject MnaGraph::toJson ( ) const

Definition at line 440 of file mna_graph.cpp.

◆ topologicalSort()

QStringList MnaGraph::topologicalSort ( ) const

Definition at line 295 of file mna_graph.cpp.

◆ upstreamNodes()

QStringList MnaGraph::upstreamNodes ( const QString & nodeId) const

Definition at line 343 of file mna_graph.cpp.

◆ validate()

bool MnaGraph::validate ( QStringList * errors = nullptr) const

Validate the graph: acyclicity, port connections, data-kind compatibility, op schema compliance, required attributes.

Parameters
errorsOptional list to receive error messages.
Returns
true if valid.

Definition at line 170 of file mna_graph.cpp.

Member Data Documentation

◆ graphInputs

QList<MnaPort> MNALIB::MnaGraph::graphInputs

Named, typed entry points.

Definition at line 86 of file mna_graph.h.

◆ graphOutputs

QList<MnaPort> MNALIB::MnaGraph::graphOutputs

Named, typed exit points.

Definition at line 87 of file mna_graph.h.

◆ paramTree

MnaParamTree MNALIB::MnaGraph::paramTree

Hierarchical parameter store with formula-driven bindings.

Definition at line 93 of file mna_graph.h.


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