CMS 3D CMS Logo

triton_utils.cc
Go to the documentation of this file.
5 
6 #include <sstream>
7 #include <experimental/iterator>
8 
9 namespace triton_utils {
10 
11  template <typename C>
12  std::string printColl(const C& coll, const std::string& delim) {
13  if (coll.empty())
14  return "";
15  std::stringstream msg;
16  //avoid trailing delim
17  std::copy(std::begin(coll), std::end(coll), std::experimental::make_ostream_joiner(msg, delim));
18  return msg.str();
19  }
20 
21  void throwIfError(const Error& err, std::string_view msg) {
22  if (!err.IsOk())
23  throw TritonException("TritonFailure") << msg << (err.Message().empty() ? "" : ": " + err.Message());
24  }
25 } // namespace triton_utils
26 
27 template std::string triton_utils::printColl(const edm::Span<std::vector<int64_t>::const_iterator>& coll,
28  const std::string& delim);
29 template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim);
30 template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim);
31 template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, const std::string& delim);
MessageLogger.h
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
mps_check.msg
tuple msg
Definition: mps_check.py:285
triton_utils::throwIfError
void throwIfError(const Error &err, std::string_view msg)
Definition: triton_utils.cc:21
mps_fire.end
end
Definition: mps_fire.py:242
triton_utils::Error
triton::client::Error Error
Definition: triton_utils.h:15
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TritonException
Definition: TritonException.h:8
triton_utils.h
gen::C
C
Definition: PomwigHadronizer.cc:78
triton_utils
Definition: triton_utils.h:13
TritonException.h
Exception.h
edm::Span
Definition: Span.h:16
triton_utils::printColl
std::string printColl(const C &coll, const std::string &delim=", ")
Definition: triton_utils.cc:12