16 #ifndef GRPPI_FF_DETAIL_SIMPLE_NODE_H
17 #define GRPPI_FF_DETAIL_SIMPLE_NODE_H
21 #include <ff/allocator.hpp>
22 #include <ff/node.hpp>
34 template <
typename Input,
typename Output,
typename Transformer>
35 class node_impl :
public ff::ff_node_t<Input,Output> {
39 transform_op_{transform_op}
42 Output *
svc(Input * p_item) {
43 return new (
ff_arena) Output{transform_op_(*p_item)};
47 Transformer transform_op_;
55 template <
typename Output,
typename Generator>
56 class node_impl<void,Output,Generator> :
public ff::ff_node {
60 generate_op_{generate_op}
64 std::experimental::optional<Output> result{generate_op_()};
66 return new (
ff_arena) Output{*result};
74 Generator generate_op_;
82 template <
typename Input,
typename Consumer>
83 class node_impl<Input,void,Consumer> :
public ff::ff_node_t<Input,void> {
87 consume_op_{consume_op}
90 void *
svc(Input * p_item) {
void * svc(void *)
Definition: simple_node.h:63
node_impl(Generator &&generate_op)
Definition: simple_node.h:59
Fastflow node for a pipeline transformation stage.
Definition: simple_node.h:35
node_impl(Transformer &&transform_op)
Definition: simple_node.h:38
Output * svc(Input *p_item)
Definition: simple_node.h:42
constexpr ff_arena_t ff_arena
Fastflow arena object. This object will be passed to placement new/delete to use FastFlow allocation ...
Definition: fastflow_allocator.h:36
Definition: callable_traits.h:21