16 #ifndef GRPPI_FF_DETAIL_FILTER_NODES_H
17 #define GRPPI_FF_DETAIL_FILTER_NODES_H
21 #include <ff/node.hpp>
33 static_assert(
sizeof(std::size_t) ==
sizeof(std::uintptr_t),
34 "std::size_t and pointers have different sizes");
35 return reinterpret_cast<T*
>(std::size_t(ff::FF_EOS - 0x11));
42 template <
typename Item,
typename Predicate>
46 predicate_{std::forward<Predicate>(predicate)}
49 Item *
svc(Item * p_item) {
50 if (predicate_(*p_item)) {
55 return filtered_value<Item>();
66 template <
typename Item>
71 Item *
svc(Item * p_item) {
72 if (p_item == filtered_value<Item>()) {
84 template <
typename Item>
89 Item *
svc(Item * p_item) {
return p_item; }
Collector node for a filter.
Definition: filter_nodes.h:67
Item * svc(Item *p_item)
Definition: filter_nodes.h:71
filter_collector()=default
Emitter for a filter stage.
Definition: filter_nodes.h:85
Item * svc(Item *p_item)
Definition: filter_nodes.h:89
Worker that passes a value to next stage if the predicate is satisfied or the filtered_value constant...
Definition: filter_nodes.h:43
filter_worker(Predicate &&predicate)
Definition: filter_nodes.h:45
Item * svc(Item *p_item)
Definition: filter_nodes.h:49
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
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:32
Definition: callable_traits.h:21