dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
ConnectionValidator.hpp
1// SPDX-FileCopyrightText: 2026 Vincent Leroy
2// SPDX-License-Identifier: MIT
3//
4// This file is part of dfx.
5//
6// Licensed under the MIT License. See the LICENSE file in the project root
7// for full license information.
8
9#pragma once
10
11// Standard includes
12#include <expected>
13#include <string>
14#include <vector>
15
151
152namespace dfx::Core
153{
154class OutputPort;
155class InputPort;
156} // !namespace dfx::Core
157
158namespace dfx::Graph
159{
164template<typename T>
165struct [[nodiscard]] ValidationResult : std::expected<T, std::vector<std::string>>
166{ using std::expected<T, std::vector<std::string>>::expected; };
167
181{
182public:
184 bool isVerificationEnabled() const noexcept { return _enabled; }
185
192 void setChannelVerification(bool enabled) { _enabled = enabled; }
193
194public:
209 std::size_t errorLimit = 0);
210
211private:
212 bool _enabled = true;
213};
214} // !namespace dfx::Graph
Incoming message endpoint attached to a node.
Definition InputPort.hpp:57
Outgoing message endpoint attached to a node.
Definition OutputPort.hpp:47
Class used to validate is a channel can be created between 2 ports.
Definition ConnectionValidator.hpp:181
void setChannelVerification(bool enabled)
Enable/disable channel verification.
Definition ConnectionValidator.hpp:192
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.
bool isVerificationEnabled() const noexcept
Whether channel verification is enabled.
Definition ConnectionValidator.hpp:184
Definition Channel.hpp:25
Definition Node.hpp:43
A specialized result type for channel connection operations. Represents either a successful operation...
Definition ConnectionValidator.hpp:166