18 #ifndef SIGNAL_FILTERS__FILTER_FACTORY_HPP_ 19 #define SIGNAL_FILTERS__FILTER_FACTORY_HPP_ 34 namespace signal_filters
54 template<
typename T,
typename ClockT = DummyClock>
55 static std::unique_ptr<FilterBase<T, ClockT>>
create(
const std::string & type,
T cutoff_frequency)
58 auto type_clean = type;
60 type_clean.begin(), type_clean.end(), type_clean.begin(),
61 [](
auto c) {
return std::tolower(c);});
62 if (
"low_pass_filter" == type_clean) {
64 }
else if (type_clean.empty() || (
"none" == type_clean)) {
67 std::string err{
"Unknown filter type: "};
69 throw std::domain_error{err};
71 return create<T, ClockT>(type_enum, cutoff_frequency);
81 template<
typename T,
typename ClockT = DummyClock>
88 return std::make_unique<LowPassFilter<T, ClockT>>(cutoff_frequency);
90 throw std::domain_error{
"Unknown filter type"};
99 #endif // SIGNAL_FILTERS__FILTER_FACTORY_HPP_
T
Definition: catr_diff.py:22
Interface definition for signal processing filters.
static std::unique_ptr< FilterBase< T, ClockT > > create(const std::string &type, T cutoff_frequency)
Definition: filter_factory.hpp:55
static std::unique_ptr< FilterBase< T, ClockT > > create(FilterType type, T cutoff_frequency)
Definition: filter_factory.hpp:82
Interface definition for signal processing filters.
Factory class to create some kind of low pass filter.
Definition: filter_factory.hpp:44
#define SIGNAL_FILTERS_PUBLIC
Definition: common/signal_filters/include/signal_filters/visibility_control.hpp:44
FilterType
Definition: filter_factory.hpp:37
Definition: low_pass_filter.hpp:36
This file defines the lanelet2_map_provider_node class.
Definition: quick_sort.hpp:24