Matches products by regex on process, module label and instance name. More...
#include <ArtDataProductSelectors.h>
Classes | |
struct | ProductRegex |
A pattern on a input tag (empty matches everything). More... | |
Public Member Functions | |
RegexDataProductSelector (std::vector< ProductRegex > patterns) | |
Initializes the selector with all the supported patterns. More... | |
template<typename SpecColl > | |
auto | makePatterns (SpecColl const &specs) -> std::vector< ProductRegex > |
Static Public Member Functions | |
static ProductRegex | makePattern (art::InputTag const &spec) |
Parses a input tag to create a single data product pattern. More... | |
template<typename SpecColl > | |
static std::vector< ProductRegex > | makePatterns (SpecColl const &specs) |
Parses a sequence of input tags to create data product patterns. More... | |
Private Member Functions | |
virtual bool | doMatch (art::BranchDescription const &brDescr) const override |
Returns whether data product described by brDescr matches. More... | |
virtual std::string | doPrint (std::string const &indent) const override |
Part of the message used when no data product matches. More... | |
bool | matchPattern (art::InputTag const &tag, ProductRegex const &ptn) const |
Returns whether the input tag matches the pattern ptn . More... | |
Private Attributes | |
std::vector< ProductRegex > | fPatterns |
All the selection patterns. More... | |
Matches products by regex on process, module label and instance name.
A pattern is matched if all specified subpatterns (process, module, instance) match. Any component of the pattern may be unspecified. A product is selected if it matches any of the configured patterns.
Patterns are matched with std::regex_match()
, i.e. the whole string must match.
The patterns may be created from one or a sequence of input-tag-like objects using makePattern()
and makePatterns()
static functions, respectively.
Definition at line 38 of file ArtDataProductSelectors.h.
util::RegexDataProductSelector::RegexDataProductSelector | ( | std::vector< ProductRegex > | patterns | ) |
Initializes the selector with all the supported patterns.
Definition at line 24 of file ArtDataProductSelectors.cxx.
|
overrideprivatevirtual |
Returns whether data product described by brDescr
matches.
Definition at line 48 of file ArtDataProductSelectors.cxx.
|
overrideprivatevirtual |
Part of the message used when no data product matches.
Definition at line 59 of file ArtDataProductSelectors.cxx.
|
static |
Parses a input tag to create a single data product pattern.
spec | pattern specification |
A specification is in the form of an art::InputTag
, but each element is a regex pattern rather than a standard name.
If the input tag is created from a string, in the usual form <processName>:<moduleLabel>:<instanceName>
(with the usual omissions), each element can't contain a :
character (no escaping is supported).
An empty tag
matches everything.
Definition at line 31 of file ArtDataProductSelectors.cxx.
|
static |
Parses a sequence of input tags to create data product patterns.
SpecColl | type of collection of specifications |
specs | sequence of pattern specifications |
Each specification in specs
is converted into a pattern via makePattern()
. The specification is explicitly converted into an input tag.
auto util::RegexDataProductSelector::makePatterns | ( | SpecColl const & | specs | ) | -> std::vector<ProductRegex> |
Definition at line 106 of file ArtDataProductSelectors.h.
|
private |
Returns whether the input tag
matches the pattern ptn
.
Definition at line 68 of file ArtDataProductSelectors.cxx.
|
private |
All the selection patterns.
Definition at line 84 of file ArtDataProductSelectors.h.