CMS 3D CMS Logo

triton_utils.cc
Go to the documentation of this file.
3 
4 #include <sstream>
5 #include <experimental/iterator>
6 
7 namespace triton_utils {
8 
9  template <typename C>
10  std::string printColl(const C& coll, const std::string& delim) {
11  if (coll.empty())
12  return "";
13  std::stringstream msg;
14  //avoid trailing delim
15  std::copy(std::begin(coll), std::end(coll), std::experimental::make_ostream_joiner(msg, delim));
16  return msg.str();
17  }
18 
19  void convertToWarning(const cms::Exception& e) { edm::LogWarning(e.category()) << e.explainSelf(); }
20 } // namespace triton_utils
21 
22 template std::string triton_utils::printColl(const edm::Span<std::vector<int64_t>::const_iterator>& coll,
23  const std::string& delim);
24 template std::string triton_utils::printColl(const std::vector<uint8_t>& coll, const std::string& delim);
25 template std::string triton_utils::printColl(const std::vector<float>& coll, const std::string& delim);
26 template std::string triton_utils::printColl(const std::vector<std::string>& coll, const std::string& delim);
27 template std::string triton_utils::printColl(const std::unordered_set<std::string>& coll, const std::string& delim);
void convertToWarning(const cms::Exception &e)
Definition: triton_utils.cc:19
tuple msg
Definition: mps_check.py:286
Definition: Span.h:16
Log< level::Warning, false > LogWarning
std::string printColl(const C &coll, const std::string &delim=", ")
Definition: triton_utils.cc:10