ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Classes | Enumerations | Functions
daq::dpm::detail Namespace Reference

Classes

struct  Rule
 Represents a keyword rule expression. More...
 

Enumerations

enum class  Operator : std::uint8_t { Include , Exclude }
 Rule operator. More...
 
enum class  Scope : std::uint8_t { Any , Value , Eso , Commentary }
 Rule scope. More...
 

Functions

Rule ParseEx (std::string_view ex)
 Parse expression of the form documented in KeywordEx. More...
 
bool KeywordScopeMatch (fits::KeywordType kwtype, Scope scope)
 
std::optional< OperatorKeywordMatch (fits::KeywordNameView kw, Rule const &rule)
 Determines if keyword match rule and if yes, whether it matches;. More...
 
std::string RegexReplace (std::string_view str, std::regex const &re, char const *fmt)
 

Class Documentation

◆ daq::dpm::detail::Rule

struct daq::dpm::detail::Rule

Represents a keyword rule expression.

Definition at line 32 of file keywordEx.hpp.

Class Members
Operator op
string pattern
Scope scope

Enumeration Type Documentation

◆ Operator

enum daq::dpm::detail::Operator : std::uint8_t
strong

Rule operator.

Enumerator
Include 
Exclude 

Definition at line 22 of file keywordEx.hpp.

◆ Scope

enum daq::dpm::detail::Scope : std::uint8_t
strong

Rule scope.

Enumerator
Any 
Value 
Eso 
Commentary 

Definition at line 27 of file keywordEx.hpp.

Function Documentation

◆ KeywordMatch()

std::optional<Operator> daq::dpm::detail::KeywordMatch ( fits::KeywordNameView  kw,
Rule const &  rule 
)

Determines if keyword match rule and if yes, whether it matches;.

Returns
std::nullopt if keyword does not match.
Include if keyword matches rule and should be included.
Exclude if keyword matches rule and should be excluded.

Definition at line 117 of file keywordEx.cpp.

◆ KeywordScopeMatch()

bool daq::dpm::detail::KeywordScopeMatch ( fits::KeywordType  kwtype,
Scope  scope 
)

Definition at line 95 of file keywordEx.cpp.

◆ ParseEx()

Rule daq::dpm::detail::ParseEx ( std::string_view  ex)

Parse expression of the form documented in KeywordEx.

Exceptions
std::invalid_argumentif expression ex is not valid.

Definition at line 17 of file keywordEx.cpp.

◆ RegexReplace()

std::string daq::dpm::detail::RegexReplace ( std::string_view  str,
std::regex const &  re,
char const *  fmt 
)

Definition at line 139 of file keywordEx.cpp.