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

MNA computational graph. 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

MNA computational graph.

Directed acyclic graph of processing nodes forming a computational pipeline.

Definition at line 70 of file mna_graph.h.

Constructor & Destructor Documentation

◆ MnaGraph()

MnaGraph::MnaGraph ( )

Definition at line 57 of file mna_graph.cpp.

Member Function Documentation

◆ addNode()

void MnaGraph::addNode ( const MnaNode & node)

Definition at line 65 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 138 of file mna_graph.cpp.

◆ dirtyNodes()

QStringList MnaGraph::dirtyNodes ( ) const

Definition at line 430 of file mna_graph.cpp.

◆ downstreamNodes()

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

Definition at line 385 of file mna_graph.cpp.

◆ fromCbor()

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

Definition at line 544 of file mna_graph.cpp.

◆ fromJson()

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

Definition at line 485 of file mna_graph.cpp.

◆ hasNode()

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

Definition at line 124 of file mna_graph.cpp.

◆ node() [1/2]

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

Definition at line 84 of file mna_graph.cpp.

◆ node() [2/2]

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

Definition at line 97 of file mna_graph.cpp.

◆ nodes() [1/2]

QList< MnaNode > & MnaGraph::nodes ( )

Definition at line 110 of file mna_graph.cpp.

◆ nodes() [2/2]

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

Definition at line 117 of file mna_graph.cpp.

◆ removeNode()

void MnaGraph::removeNode ( const QString & nodeId)

Definition at line 72 of file mna_graph.cpp.

◆ toCbor()

QCborMap MnaGraph::toCbor ( ) const

Definition at line 513 of file mna_graph.cpp.

◆ toJson()

QJsonObject MnaGraph::toJson ( ) const

Definition at line 445 of file mna_graph.cpp.

◆ topologicalSort()

QStringList MnaGraph::topologicalSort ( ) const

Definition at line 300 of file mna_graph.cpp.

◆ upstreamNodes()

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

Definition at line 348 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 175 of file mna_graph.cpp.

Member Data Documentation

◆ graphInputs

QList<MnaPort> MNALIB::MnaGraph::graphInputs

Named, typed entry points.

Definition at line 91 of file mna_graph.h.

◆ graphOutputs

QList<MnaPort> MNALIB::MnaGraph::graphOutputs

Named, typed exit points.

Definition at line 92 of file mna_graph.h.

◆ paramTree

MnaParamTree MNALIB::MnaGraph::paramTree

Hierarchical parameter store with formula-driven bindings.

Definition at line 98 of file mna_graph.h.


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