21 #ifndef GRPPI_FF_DETAIL_FILTER_NODES_H 22 #define GRPPI_FF_DETAIL_FILTER_NODES_H 26 #include <ff/node.hpp> 38 static_assert(
sizeof(std::size_t) ==
sizeof(std::uintptr_t));
39 return reinterpret_cast<T*
>(std::size_t(ff::FF_EOS - 0x11));
46 template <
typename Item,
typename Predicate>
50 predicate_{std::forward<Predicate>(predicate)}
53 Item *
svc(Item * p_item) {
54 if (predicate_(*p_item)) {
59 return filtered_value<Item>();
70 template <
typename Item>
75 Item *
svc(Item * p_item) {
76 if (p_item == filtered_value<Item>()) {
88 template <
typename Item>
93 Item *
svc(Item * p_item) {
return p_item; }
Definition: callable_traits.h:26
Worker that passes a value to next stage if the predicate is satisfied or the filtered_value constant...
Definition: filter_nodes.h:47
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
Item * svc(Item *p_item)
Definition: filter_nodes.h:93
Item * svc(Item *p_item)
Definition: filter_nodes.h:75
Emitter for a filter stage.
Definition: filter_nodes.h:89
Item * svc(Item *p_item)
Definition: filter_nodes.h:53
filter_worker(Predicate &&predicate)
Definition: filter_nodes.h:49
Colletor node for a filter.
Definition: filter_nodes.h:71
constexpr T * filtered_value()
Get a pointer representation of the filter constant to be used as special value when a value is filte...
Definition: filter_nodes.h:37