6 #ifndef DAQ_DPM_KEYWORD_RULE_HPP
7 #define DAQ_DPM_KEYWORD_RULE_HPP
49 m_rules.emplace_back(std::move(rule));
53 std::vector<Rule> m_rules;
56 template <
class InputIt,
class OutputIt>
58 Filter(InputIt first, InputIt last, OutputIt d_first,
KeywordEx const& filter_ex) {
60 first, last, d_first, [&filter_ex](
auto const kw) {
return KeywordMatch(kw, filter_ex); });
63 template <
class InputIt,
class OutputIt>
68 std::regex
const& regex,
70 while (first != last) {
Create keyword expression that memoize the provided string pattern.
Interface for keyword rule processors.
@ None
None (to disable keyword copying)
@ User
Default is to keep only user-keywords.
@ All
Default rule is to keep all keywords (useful for in-place merge)
virtual ~KeywordRuleProcessor() noexcept=default
virtual fits::KeywordVector Process(fits::KeywordVector const &, DefaultRule default_rule) const =0
std::function< fits::KeywordVector(fits::KeywordVector const &)> Rule
StandardKeywordRuleProcessor()=default
Contains data structure for FITS keywords.
fits::KeywordVariant KeywordTransform(fits::KeywordVariant const &keyword, std::regex const &re, char const *fmt)
Transforms keyword name using regex.
bool KeywordMatch(fits::KeywordVariant const &keyword, KeywordEx const &ex)
constexpr OutputIt Filter(InputIt first, InputIt last, OutputIt d_first, KeywordEx const &filter_ex)
OutputIt Transform(InputIt first, InputIt last, OutputIt d_first, KeywordEx const &filter_ex, std::regex const ®ex, char const *fmt)
std::vector< KeywordVariant > KeywordVector
Vector of keywords.