21 #ifndef GRPPI_FF_DETAIL_SIMPLE_NODE_H 22 #define GRPPI_FF_DETAIL_SIMPLE_NODE_H 26 #include <ff/allocator.hpp> 27 #include <ff/node.hpp> 39 template <
typename Input,
typename Output,
typename Transformer>
40 class node_impl :
public ff::ff_node_t<Input,Output> {
44 transform_op_{transform_op}
47 Output *
svc(Input * p_item) {
48 return new (
ff_arena) Output{transform_op_(*p_item)};
52 Transformer transform_op_;
60 template <
typename Output,
typename Generator>
61 class node_impl<void,Output,Generator> :
public ff::ff_node {
65 generate_op_{generate_op}
69 std::experimental::optional<Output> result{generate_op_()};
71 return new (
ff_arena) Output{*result};
79 Generator generate_op_;
87 template <
typename Input,
typename Consumer>
88 class node_impl<Input,void,Consumer> :
public ff::ff_node_t<Input,void> {
92 consume_op_{consume_op}
95 void *
svc(Input * p_item) {
102 Consumer consume_op_;
Definition: callable_traits.h:26
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:41
Fastflow node for a pipeline transformation stage.
Definition: simple_node.h:40
node_impl(Generator &&generate_op)
Definition: simple_node.h:64
node_impl(Transformer &&transform_op)
Definition: simple_node.h:43
Output * svc(Input *p_item)
Definition: simple_node.h:47
void * svc(void *)
Definition: simple_node.h:68