20 : pattern_(), parsed_patterns_()
22 if (pattern.empty()) {
24 <<
"EventIDMatcher given an empty pattern!";
34 if (patterns.size() == 0) {
36 <<
"EventIDMatcher given an empty list of patterns!";
40 for (
auto const&
val : patterns) {
43 <<
"EventIDMatcher given an empty pattern!";
61 "[[:blank:]]*-[[:blank:]]*" 68 for (
auto const& given_pattern :
pattern_) {
70 regex_iterator<string::const_iterator>
I(
71 given_pattern.cbegin(), given_pattern.cend(), pat);
72 regex_iterator<string::const_iterator>
E;
82 if (
m.str(7).size()) {
85 if (
m.position() != (prev_pos + prev_len)) {
89 buf <<
"Illegal character in pattern near here:\n";
92 for (
auto i = 0L; i < (prev_pos + prev_len); ++i) {
101 }
else if (
m[4].matched) {
104 for (
auto val :
m.str(4)) {
111 for (
auto val :
m.str(5)) {
112 num_low = (num_low * 10U) + (
val -
'0');
115 for (
auto val :
m.str(6)) {
116 num_high = (num_high * 10U) + (
val -
'0');
119 {num_low, num_high,
false});
122 if (part_num == 0U) {
124 }
else if (part_num == 1U) {
126 }
else if (part_num == 2U) {
131 <<
"Syntax error, event part of pattern ended with a ':' here:\n";
132 buf << given_pattern;
134 for (
auto i = 0L; i <
m.position(7); ++i) {
141 }
else if (sep ==
',') {
146 prev_pos =
m.position();
147 prev_len =
m.length();
150 if (prev_sep !=
'\0') {
154 printf(
"pep: Syntax error, near here:\n");
155 buf << given_pattern;
157 for (
auto i = 0L; i < (prev_pos + prev_len); ++i) {
163 if (static_cast<string::size_type>(prev_pos + prev_len) !=
164 given_pattern.size()) {
168 printf(
"pep: Syntax error, near here:\n");
169 buf << given_pattern;
171 for (
auto i = 0L; i < (prev_pos + prev_len); ++i) {
201 for (
auto i = 0U; i < 3; ++i) {
202 for (
auto const&
val : parsed_pattern[i]) {
207 }
else if (
val.low ==
val.high) {
211 if (eid.
run() ==
val.low) {
215 }
else if (i == 1U) {
232 if ((eid.
run() >=
val.low) && (eid.
run() <=
val.high)) {
236 }
else if (i == 1U) {
RunID const & runID() const
SubRunID const & subRunID() const
bool match(EventID const &) const
std::vector< std::string > pattern_
bool operator()(EventID const &) const
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
EventIDMatcher(std::string const &pattern)
EventNumber_t event() const
std::vector< std::vector< std::vector< PatternRangeElement > > > parsed_patterns_
SubRunNumber_t subRun() const