1 #ifndef art_Framework_Principal_Selector_h 2 #define art_Framework_Principal_Selector_h 40 #include <type_traits> 45 std::is_base_of_v<SelectorBase, std::remove_reference_t<T>>;
66 :
pn_{pn.empty() ? std::string{
"*"} : pn}
79 std::string result{indent +
"Process name: "};
83 result +=
"'" +
pn_ +
"'";
110 return indent +
"Product instance name: '" + pin_ +
'\'';
135 return indent +
"Module label: '" + label_ +
'\'';
164 template <
typename FUNC>
166 : func_(func), description_(description)
179 return indent + description_;
182 std::function<bool(art::BranchDescription const&)>
func_;
194 template <
typename IT>
198 std::string
const& description,
199 std::enable_if_t<std::is_convertible_v<decltype(std::declval<IT>().
202 [[maybe_unused]] =
nullptr)
203 : tags_{
begin, end}, description_{description}
206 std::vector<art::InputTag>
const&
228 return indent + description_;
231 std::vector<art::InputTag>
const tags_;
240 template <
typename A,
typename B>
249 return a_.match(p) && b_.match(p);
255 return a_.print(indent) +
'\n' + b_.print(indent);
262 template <
typename A,
typename B>
274 template <
typename A,
typename B>
283 return a_.match(p) || b_.match(p);
289 std::string result{indent +
"[\n"};
290 result += indent + a_.print(indent) +
'\n';
291 result += indent + indent + indent +
"or\n";
292 result += indent + b_.print(indent) +
'\n';
293 result += indent +
']';
301 template <
typename A,
typename B>
302 std::enable_if_t<is_selector<A> && is_selector<B>,
OrHelper<A, B>>
313 template <
typename A>
328 std::string result{indent +
"Not [\n"};
329 result += indent + a_.print(indent) +
'\n';
330 result += indent +
']';
336 template <
typename A>
348 template <
typename T>
358 return expression_.match(p);
364 return expression_.print(indent);
376 template <
typename T>
383 std::string
doPrint(std::string
const&
indent)
const override;
385 std::shared_ptr<SelectorBase>
sel_;
decltype(auto) constexpr cend(T &&obj)
ADL-aware version of std::cend.
std::function< bool(art::BranchDescription const &)> func_
constexpr bool is_selector
AndHelper(A const &a, B const &b)
std::shared_ptr< SelectorBase > sel_
Selector(T const &expression)
bool doMatch(BranchDescription const &p) const override
ProductInstanceNameSelector(std::string const &pin)
std::enable_if_t< is_selector< A >, NotHelper< A > > operator!(A const &a)
std::string doPrint(std::string const &) const override
bool doMatch(BranchDescription const &p) const override
bool doMatch(BranchDescription const &p) const override
std::string const & processName() const noexcept
std::string doPrint(std::string const &indent) const override
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
std::enable_if_t< is_selector< A > &&is_selector< B >, AndHelper< A, B > > operator&&(A const &a, B const &b)
std::string doPrint(std::string const &indent) const override
bool doMatch(BranchDescription const &p) const override
std::string doPrint(std::string const &indent) const override
std::string indent(std::size_t const i)
bool doMatch(BranchDescription const &) const override
bool doMatch(BranchDescription const &p) const override
std::string doPrint(std::string const &indent) const override
SelectorByFunction(FUNC func, std::string description)
bool doMatch(BranchDescription const &p) const override
ModuleLabelSelector(std::string const &label)
std::string doPrint(std::string const &indent) const override
std::string doPrint(std::string const &indent) const override
std::string const & moduleLabel() const noexcept
OrHelper(A const &a, B const &b)
bool doMatch(BranchDescription const &p) const override
ComposedSelectorWrapper(T const &t)
std::string const & productInstanceName() const noexcept
ProcessNameSelector(std::string const &pn)
std::string doPrint(std::string const &indent) const override
decltype(auto) constexpr cbegin(T &&obj)
ADL-aware version of std::cbegin.
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
bool doMatch(art::BranchDescription const &p) const override
std::enable_if_t< is_selector< A > &&is_selector< B >, OrHelper< A, B > > operator||(A const &a, B const &b)
std::string doPrint(std::string const &indent) const override