include
fkie_message_filters
simple_user_filter.h
Go to the documentation of this file.
1
/****************************************************************************
2
*
3
* fkie_message_filters
4
* Copyright © 2018-2020 Fraunhofer FKIE
5
* Author: Timo Röhling
6
*
7
* Licensed under the Apache License, Version 2.0 (the "License");
8
* you may not use this file except in compliance with the License.
9
* You may obtain a copy of the License at
10
*
11
* http://www.apache.org/licenses/LICENSE-2.0
12
*
13
* Unless required by applicable law or agreed to in writing, software
14
* distributed under the License is distributed on an "AS IS" BASIS,
15
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
* See the License for the specific language governing permissions and
17
* limitations under the License.
18
*
19
****************************************************************************/
20
#ifndef INCLUDE_FKIE_MESSAGE_FILTERS_SIMPLE_USER_FILTER_H_
21
#define INCLUDE_FKIE_MESSAGE_FILTERS_SIMPLE_USER_FILTER_H_
22
23
#include "
filter.h
"
24
#include <functional>
25
26
namespace
fkie_message_filters
27
{
28
37
template
<
typename
... Inputs>
38
class
SimpleUserFilter :
public
Filter
<IO<Inputs...>, IO<Inputs...>>
39
{
40
public
:
49
using
ProcessingFunction
= std::function<bool(
const
Inputs&...)>;
56
void
set_processing_function
(
const
ProcessingFunction
& f) noexcept;
57
protected
:
58
void
receive
(
const
Inputs&... in)
override
;
59
private
:
60
ProcessingFunction
f_
;
61
};
62
63
template
<
typename
... Inputs>
64
class
SimpleUserFilter
<
IO
<Inputs...>> :
public
SimpleUserFilter
<Inputs...> {};
65
66
}
// namespace fkie_message_filters
67
68
#include "
simple_user_filter_impl.h
"
69
70
#endif
/* INCLUDE_FKIE_MESSAGE_FILTERS_SIMPLE_USER_FILTER_H_ */
fkie_message_filters
Definition:
buffer.h:33
fkie_message_filters::SimpleUserFilter::ProcessingFunction
std::function< bool(const Inputs &...)> ProcessingFunction
Processing function type.
Definition:
simple_user_filter.h:85
Filter
filter.h
fkie_message_filters::IO
Group multiple data types as filter input or output.
Definition:
io.h:45
fkie_message_filters::SimpleUserFilter::set_processing_function
void set_processing_function(const ProcessingFunction &f) noexcept
Set the user-defined processing function.
Definition:
simple_user_filter_impl.h:47
fkie_message_filters::SimpleUserFilter
Simplified filter with user-defined callback function.
Definition:
simple_user_filter.h:56
simple_user_filter_impl.h
fkie_message_filters::SimpleUserFilter::receive
void receive(const Inputs &... in) override
Process incoming data.
Definition:
simple_user_filter_impl.h:53
fkie_message_filters::SimpleUserFilter::f_
ProcessingFunction f_
Definition:
simple_user_filter.h:96
fkie_message_filters
Author(s): Timo Röhling
autogenerated on Wed Mar 2 2022 00:18:57