dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
dfx::Graph::ConnectionValidator Class Reference

Class used to validate is a channel can be created between 2 ports. More...

#include <dfx-graph/ConnectionValidator.hpp>

Public Member Functions

bool isVerificationEnabled () const noexcept
 Whether channel verification is enabled.
void setChannelVerification (bool enabled)
 Enable/disable channel verification.
ValidationResult< void > checkConnection (Core::OutputPort const &src, Core::InputPort const &dst, std::size_t errorLimit=0)
 Validates whether a logical connection can be established between two local ports.

Detailed Description

Class used to validate is a channel can be created between 2 ports.

By default, channel creation is verified (setChannelVerification() and Graph channel verification (kind + mime-type compatibility)). Verification rejects connections that are incompatible by:

  • port kind mismatch (input/output kind),
  • mime-type incompatibilities, including propagation constraints.

The verification logic is intentionally conservative: when ports declare any mime-type, the controller can infer possible mime-types by walking existing connections and applying propagation rules (node-level and port-level).

Member Function Documentation

◆ checkConnection()

ValidationResult< void > dfx::Graph::ConnectionValidator::checkConnection ( Core::OutputPort const & src,
Core::InputPort const & dst,
std::size_t errorLimit = 0 )

Validates whether a logical connection can be established between two local ports.

This function performs a comprehensive compatibility check described in Graph channel verification (kind + mime-type compatibility)

Parameters
srcThe source output port.
dstThe destination input port.
errorLimitThe maximum number of errors to collect before stopping. A value of 0 indicates that all detected errors should be returned.
Returns
A ValidationResult<void> which is:
  • Valid (holds no value) if the ports are compatible.
  • Invalid (holds a std::vector<std::string>) if conflicts were found, containing descriptions of why the connection is impossible.

◆ isVerificationEnabled()

bool dfx::Graph::ConnectionValidator::isVerificationEnabled ( ) const
inlinenoexcept

Whether channel verification is enabled.

◆ setChannelVerification()

void dfx::Graph::ConnectionValidator::setChannelVerification ( bool enabled)
inline

Enable/disable channel verification.

When disabled, checkConnection() skips compatibility checks entirely. This is mainly intended for debugging or for scenarios where compatibility is enforced elsewhere.

See also
Graph channel verification (kind + mime-type compatibility)

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