Public Member Functions | Private Attributes | List of all members
art::InputTag Class Reference

#include <InputTag.h>

Public Member Functions

 ~InputTag ()
 
 InputTag ()
 
 InputTag (std::string const &label, std::string const &instance, std::string const &processName={})
 
 InputTag (char const *label, char const *instance, char const *processName="")
 
 InputTag (std::string const &)
 
 InputTag (char const *)
 
 InputTag (InputTag const &)
 
 InputTag (InputTag &&)
 
InputTagoperator= (InputTag const &)
 
InputTagoperator= (InputTag &&)
 
bool operator== (InputTag const &) const noexcept
 
bool empty () const noexcept
 
std::string const & label () const noexcept
 
std::string const & instance () const noexcept
 
std::string const & process () const noexcept
 
std::string encode () const
 

Private Attributes

std::string label_ {}
 
std::string instance_ {}
 
std::string process_ {}
 

Detailed Description

Definition at line 12 of file InputTag.h.

Constructor & Destructor Documentation

art::InputTag::~InputTag ( )
default
art::InputTag::InputTag ( )
default
art::InputTag::InputTag ( std::string const &  label,
std::string const &  instance,
std::string const &  processName = {} 
)

Definition at line 21 of file InputTag.cc.

24  : label_{label}, instance_{instance}, process_{processName}
25  {}
std::string const & instance() const noexcept
Definition: InputTag.cc:85
std::string label_
Definition: InputTag.h:46
std::string process_
Definition: InputTag.h:48
std::string const & label() const noexcept
Definition: InputTag.cc:79
std::string instance_
Definition: InputTag.h:47
art::InputTag::InputTag ( char const *  label,
char const *  instance,
char const *  processName = "" 
)

Definition at line 27 of file InputTag.cc.

30  : label_{label}, instance_{instance}, process_{processName}
31  {}
std::string const & instance() const noexcept
Definition: InputTag.cc:85
std::string label_
Definition: InputTag.h:46
std::string process_
Definition: InputTag.h:48
std::string const & label() const noexcept
Definition: InputTag.cc:79
std::string instance_
Definition: InputTag.h:47
art::InputTag::InputTag ( std::string const &  s)

Definition at line 33 of file InputTag.cc.

34  {
35  vector<string> tokens;
36  boost::split(tokens, s, boost::is_any_of(":"), boost::token_compress_off);
37  auto const nwords = tokens.size();
38  if (nwords > 3u) {
40  "An error occurred while creating an input tag.\n")
41  << "The string '" << s
42  << "' has more than three colon-delimited tokens.\n"
43  "The supported syntax is '<module_label>:<optional instance "
44  "name>:<optional process name>'.";
45  }
46  if (nwords > 0) {
47  label_ = tokens[0];
48  }
49  if (nwords > 1) {
50  instance_ = tokens[1];
51  }
52  if (nwords > 2) {
53  process_ = tokens[2];
54  }
55  }
std::string label_
Definition: InputTag.h:46
std::string process_
Definition: InputTag.h:48
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
std::string instance_
Definition: InputTag.h:47
static QCString * s
Definition: config.cpp:1042
art::InputTag::InputTag ( char const *  s)

Definition at line 57 of file InputTag.cc.

57 : InputTag{string{s}} {}
static QCString * s
Definition: config.cpp:1042
art::InputTag::InputTag ( InputTag const &  )
default
art::InputTag::InputTag ( InputTag &&  )
default

Member Function Documentation

bool art::InputTag::empty ( ) const
noexcept

Definition at line 73 of file InputTag.cc.

74  {
75  return label_.empty() && instance_.empty() && process_.empty();
76  }
std::string label_
Definition: InputTag.h:46
std::string process_
Definition: InputTag.h:48
std::string instance_
Definition: InputTag.h:47
string art::InputTag::encode ( ) const

Definition at line 97 of file InputTag.cc.

98  {
99  static string const separator{":"};
100  string result = label_;
101  if (!instance_.empty() || !process_.empty()) {
102  result += separator + instance_;
103  }
104  if (!process_.empty()) {
105  result += separator + process_;
106  }
107  return result;
108  }
static QCString result
std::string label_
Definition: InputTag.h:46
std::string process_
Definition: InputTag.h:48
std::string instance_
Definition: InputTag.h:47
string const & art::InputTag::instance ( ) const
noexcept

Definition at line 85 of file InputTag.cc.

86  {
87  return instance_;
88  }
std::string instance_
Definition: InputTag.h:47
string const & art::InputTag::label ( ) const
noexcept

Definition at line 79 of file InputTag.cc.

80  {
81  return label_;
82  }
std::string label_
Definition: InputTag.h:46
InputTag & art::InputTag::operator= ( InputTag const &  )
default
InputTag & art::InputTag::operator= ( InputTag &&  )
default
bool art::InputTag::operator== ( InputTag const &  tag) const
noexcept

Definition at line 66 of file InputTag.cc.

67  {
68  return (label_ == tag.label_) && (instance_ == tag.instance_) &&
69  (process_ == tag.process_);
70  }
std::string label_
Definition: InputTag.h:46
std::string process_
Definition: InputTag.h:48
std::string instance_
Definition: InputTag.h:47
string const & art::InputTag::process ( ) const
noexcept

Definition at line 91 of file InputTag.cc.

92  {
93  return process_;
94  }
std::string process_
Definition: InputTag.h:48

Member Data Documentation

std::string art::InputTag::instance_ {}
private

Definition at line 47 of file InputTag.h.

std::string art::InputTag::label_ {}
private

Definition at line 46 of file InputTag.h.

std::string art::InputTag::process_ {}
private

Definition at line 48 of file InputTag.h.


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