LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
art::ProcessNameSelector Class Reference

#include "Selector.h"

Inheritance diagram for art::ProcessNameSelector:
art::SelectorBase

Public Member Functions

 ProcessNameSelector (std::string const &pn)
 
bool match (BranchDescription const &p) const
 
std::string print (std::string const &indent) const
 

Private Member Functions

bool doMatch (BranchDescription const &p) const override
 
std::string doPrint (std::string const &indent) const override
 

Private Attributes

std::string pn_
 

Detailed Description

Definition at line 63 of file Selector.h.

Constructor & Destructor Documentation

art::ProcessNameSelector::ProcessNameSelector ( std::string const &  pn)
inlineexplicit

Definition at line 65 of file Selector.h.

66  : pn_{pn.empty() ? std::string{"*"} : pn}
67  {}

Member Function Documentation

bool art::ProcessNameSelector::doMatch ( BranchDescription const &  p) const
inlineoverrideprivatevirtual

Implements art::SelectorBase.

Definition at line 71 of file Selector.h.

References pn_, and art::BranchDescription::processName().

Referenced by art::Selector::Selector().

72  {
73  return (pn_ == "*") || (p.processName() == pn_);
74  }
std::string art::ProcessNameSelector::doPrint ( std::string const &  indent) const
inlineoverrideprivatevirtual

Implements art::SelectorBase.

Definition at line 77 of file Selector.h.

References pn_.

Referenced by art::Selector::Selector().

78  {
79  std::string result{indent + "Process name: "};
80  if (pn_ == "*") {
81  result += "(empty)";
82  } else {
83  result += "'" + pn_ + "'";
84  }
85  return result;
86  }
std::string indent(std::size_t const i)
bool art::SelectorBase::match ( BranchDescription const &  p) const
inlineinherited

Definition at line 41 of file SelectorBase.h.

References art::SelectorBase::doMatch().

Referenced by art::Principal::findGroupsForProcess().

42  {
43  return doMatch(p);
44  }
virtual bool doMatch(BranchDescription const &p) const =0
std::string art::SelectorBase::print ( std::string const &  indent) const
inlineinherited

Definition at line 47 of file SelectorBase.h.

References art::SelectorBase::doMatch(), art::SelectorBase::doPrint(), and art::detail::indent().

Referenced by art::Principal::getBySelector().

48  {
49  return doPrint(indent);
50  }
std::string indent(std::size_t const i)
virtual std::string doPrint(std::string const &indent) const =0

Member Data Documentation

std::string art::ProcessNameSelector::pn_
private

Definition at line 88 of file Selector.h.

Referenced by doMatch(), and doPrint().


The documentation for this class was generated from the following file: