ifw-daq
2.1.0-pre1
IFW Data Acquisition modules
|
Go to the documentation of this file.
6 #ifndef DAQ_DPM_KEYWORD_RULE_HPP
7 #define DAQ_DPM_KEYWORD_RULE_HPP
44 m_rules.emplace_back(std::move(rule));
48 std::vector<Rule> m_rules;
51 template <
class InputIt,
class OutputIt>
53 Filter(InputIt first, InputIt last, OutputIt d_first,
KeywordEx const& filter_ex) {
55 first, last, d_first, [&filter_ex](
auto const kw) {
return KeywordMatch(kw, filter_ex); });
58 template <
class InputIt,
class OutputIt>
63 std::regex
const& regex,
65 while (first != last) {
77 #endif // #ifndef DAQ_DPM_KEYWORD_RULE_HPP
virtual ~KeywordRuleProcessor() noexcept=default
virtual fits::KeywordVector Process(fits::KeywordVector const &, DefaultRule default_rule) const =0
Contains data structure for FITS keywords.
std::function< fits::KeywordVector(fits::KeywordVector const &)> Rule
fits::KeywordVariant KeywordTransform(fits::KeywordVariant const &keyword, std::regex const &re, char const *fmt)
Transforms keyword name using regex.
@ User
Default is to keep only user-keywords.
Create keyword expression that memoize the provided string pattern.
constexpr OutputIt Filter(InputIt first, InputIt last, OutputIt d_first, KeywordEx const &filter_ex)
StandardKeywordRuleProcessor()=default
@ All
Default rule is to keep all keywords (useful for in-place merge)
std::vector< KeywordVariant > KeywordVector
Vector of keywords.
OutputIt Transform(InputIt first, InputIt last, OutputIt d_first, KeywordEx const &filter_ex, std::regex const ®ex, char const *fmt)
bool KeywordMatch(fits::KeywordVariant const &keyword, KeywordEx const &ex)
Interface for keyword rule processors.