SatDump 2.0.0-alpha-520736c72
Loading...
Searching...
No Matches
dsp_flowgraph_register.h
1#pragma once
2
3#include "dsp/flowgraph/flowgraph.h"
4
5namespace satdump
6{
7 namespace ndsp
8 {
9 template <typename T>
10 void registerNodeSimple(ndsp::Flowgraph &flowgraph, std::string menuname)
11 {
12 std::string id = T().d_id;
13 flowgraph.node_internal_registry.insert({id, {menuname, [](const ndsp::Flowgraph *f) { return std::make_shared<ndsp::NodeInternal>(f, std::make_shared<T>()); }}});
14 }
15
16 template <typename T>
17 void registerNode(ndsp::Flowgraph &flowgraph, std::string menuname)
18 {
19 std::string id = T(&flowgraph).blk->d_id;
20 flowgraph.node_internal_registry.insert({id, {menuname, [](const ndsp::Flowgraph *f) { return std::make_shared<T>(f); }}});
21 }
22
24 {
25 std::map<std::string, ndsp::Flowgraph::NodeInternalReg> &r;
26 };
27
28 void registerNodesInFlowgraph(ndsp::Flowgraph &flowgraph);
29 } // namespace ndsp
30} // namespace satdump
Definition flowgraph.h:28
Definition dsp_flowgraph_register.h:24