artdaq_mfextensions  v1_03_05
suppress.hh
1 #ifndef MFEXTENSIONS_SUPPRESS_H
2 #define MFEXTENSIONS_SUPPRESS_H
3 
4 #include <boost/regex.hpp>
5 #include <string>
6 
7 typedef boost::regex regex_t;
8 typedef boost::smatch smatch_t;
9 
13 class suppress {
14  public:
19  explicit suppress(std::string const& name);
20 
26  bool match(std::string const& name);
27 
32  void use(bool flag) { in_use_ = flag; }
33 
34  private:
35  std::string name_;
36  regex_t expr_;
37  smatch_t what_;
38  bool in_use_;
39 };
40 
41 #endif
suppress(std::string const &name)
Construct a suppression using the given name for regex matching
Definition: suppress.cc:3
Suppress messages based on a regular expression
Definition: suppress.hh:13
void use(bool flag)
Set whether the suppression is active
Definition: suppress.hh:32
bool match(std::string const &name)
Check if the name matches this suppression
Definition: suppress.cc:5