LambdaStage.h File
Function-based stage executor wrapper. More...
Included Headers
#include "graph/StageExecutor.h"
#include "graph/nodes/StageNode.h"
#include <functional>
#include <memory>
#include <string>
#include <utility>
#include <vector>
Namespaces Index
| namespace | simaai |
| namespace | neat |
| namespace | graph |
| namespace | nodes |
Classes Index
| class | LambdaStage |
|
Generic stage executor whose behavior is supplied by user-provided callbacks. More... | |
Description
Function-based stage executor wrapper.
File Listing
The file content with the documentation metadata removed is:
8#include "graph/StageExecutor.h"
9#include "graph/nodes/StageNode.h"
17namespace simaai::neat::graph::nodes {
21using LambdaOnInput = std::function<void(StageMsg&&, std::vector<StageOutMsg>&, const StagePorts&)>;
24using LambdaOnTick =
25 std::function<void(std::int64_t, std::vector<StageOutMsg>&, const StagePorts&)>;
38class LambdaStage final : public simaai::neat::graph::StageExecutor {
49 void set_ports(const StagePorts& ports) override {
65 StagePorts ports_;
66 LambdaOnInput on_input_;
67 LambdaOnTick on_tick_;
84LambdaStageNode(std::string kind, std::vector<std::string> inputs, std::vector<std::string> outputs,
85 LambdaOnInput on_input, std::string label = {}, StageNodeOptions options = {},
86 StageNode::OutputSpecFn out_fn = {}, LambdaOnTick on_tick = {}) {
87 LambdaOnInput fn = std::move(on_input);
88 LambdaOnTick tick = std::move(on_tick);
89 StageNode::StageExecutorFactory factory = [fn, tick]() mutable {
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.9.8.