dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
Graph.hpp
1// SPDX-FileCopyrightText: 2025 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 <memory>
13
14namespace dfx::Core
15{
16class Node;
17using NodePtr = std::shared_ptr<Node>;
18
19class Channel;
20using ChannelPtr = std::shared_ptr<Channel>;
21} // !namespace dfx::Core
22
23namespace dfx::Hooks
24{
53class Graph
54{
55public:
56 virtual ~Graph() = default;
57
68 virtual void onNodeCreated(Core::NodePtr node) = 0;
69
81 virtual void onNodeRemoved(Core::NodePtr node) = 0;
82
89 virtual void onChannelCreated(Core::ChannelPtr channel) = 0;
90
98 virtual void onChannelRemoved(Core::ChannelPtr channel) = 0;
99};
100} // !namespace dfx::Hooks
Abstract message channel connecting exactly one output port to one input port.
Definition Channel.hpp:54
Abstract base class for all nodes in the dfx runtime.
Definition Node.hpp:91
Hooks related to the lifecycle of graph objects (nodes and channels).
Definition Graph.hpp:54
virtual void onChannelRemoved(Core::ChannelPtr channel)=0
Called when a channel is being removed from the graph.
virtual void onNodeCreated(Core::NodePtr node)=0
Called after a node has been created and is known to the runtime.
virtual void onChannelCreated(Core::ChannelPtr channel)=0
Called after a channel has been created and registered in the graph.
virtual void onNodeRemoved(Core::NodePtr node)=0
Called when a node is being removed from the graph.
Definition Channel.hpp:22
std::shared_ptr< Node > NodePtr
Shared ownership pointer type for Nodes..
Definition Node.hpp:61
std::shared_ptr< Channel > ChannelPtr
Shared ownership handle for channels.
Definition Channel.hpp:147
Definition Delivery.hpp:26