dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
Generator.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// Project includes
12#include "../ThreadBased.hpp"
13
14namespace dfx::Node
15{
16class Generator : public ThreadBased
17{
18 DFX_NODE("Generator")
19
20public:
21 Generator(Id id, std::string name);
22
23protected:
24 void initializeImpl(nlohmann::json config) override;
25
26protected:
27 void exec(std::stop_token stopToken) override;
28
29private:
30 double _frequency = 1.;
31};
32} // !namespace dfx::Node
#define DFX_NODE(typeName)
Convenience macro to declare the node type string and metadata/schema hooks.
Definition Node.hpp:501
uint32_t Id
Node identifier type (unique and stable within a graph instance).
Definition Node.hpp:113
nlohmann::json const & config() const noexcept
Get the node configuration.
Definition Node.hpp:138
std::string const & name() const noexcept
Get the node name.
Definition Node.hpp:134
void initializeImpl(nlohmann::json config) override
Called by initialize; derived nodes must parse config here.
Definition MimeTypeRouter.hpp:18