dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
Node.hpp File Reference

Base class for all runtime-executed nodes in a dfx dataflow graph. More...

Include dependency graph for Node.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  dfx::Core::Node
 Abstract base class for all nodes in the dfx runtime. More...

Concepts

concept  dfx::Core::DerivedFromNode
 Concept used by dfx::Core::Node::is() and dfx::Core::Node::as() to constrain types.

Macros

#define DFX_NODE(typeName)
 Convenience macro to declare the node type string and metadata/schema hooks.

Typedefs

using dfx::Core::NodePtr = std::shared_ptr<Node>
 Shared ownership pointer type for Nodes..
using dfx::Core::NodeWPtr = std::weak_ptr<Node>
 Weak pointer type for Nodes.

Functions

 DECLARE_ENUM_STRING_FUNCTIONS (dfx::Core::Node::ExecutionFlowPolicy)

Detailed Description

Base class for all runtime-executed nodes in a dfx dataflow graph.

A dfx::Core::Node is the central runtime entity of dfx:

  • It owns a set of named input/output ports.
  • It receives messages on input ports and produces messages through output ports.
  • It has a JSON configuration (dfx::Core::Node::config()) populated during dfx::Core::Node::initialize().
  • It can be started/stopped; derived classes implement their own lifecycle hooks.

Nodes are typically created by the graph layer (e.g. dfx::Graph::NodeFactory), wired through ports, configured, and then executed by the runtime.

Macro Definition Documentation

◆ DFX_NODE

#define DFX_NODE ( typeName)
Value:
public: \
static constexpr auto type = typeName; \
\
public: \
static nlohmann::json staticConfigSchema(); \
nlohmann::json configSchema() const override { return staticConfigSchema(); } \
static nlohmann::json staticMetadata(); \
nlohmann::json metadata() const override { return staticMetadata(); }\
private:

Convenience macro to declare the node type string and metadata/schema hooks.

Intended usage inside a node class definition:

class MyNode : public dfx::Core::Node
{
DFX_NODE("my-node");
// ...
};
#define DFX_NODE(typeName)
Convenience macro to declare the node type string and metadata/schema hooks.
Definition Node.hpp:501
Abstract base class for all nodes in the dfx runtime.
Definition Node.hpp:91

Expands to:

  • static constexpr auto type
  • staticConfigSchema() / configSchema() override
  • staticMetadata() / metadata() override