LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
triton_utils Namespace Reference

Typedefs

using Error = triton::client::Error
 

Functions

template<typename C >
std::string printColl (const C &coll, const std::string &delim)
 
void throwIfError (const Error &err, std::string_view msg)
 
bool warnIfError (const Error &err, std::string_view msg)
 

Typedef Documentation

using triton_utils::Error = typedef triton::client::Error

Definition at line 12 of file triton_utils.h.

Function Documentation

template<typename C >
std::string triton_utils::printColl ( const C &  coll,
const std::string &  delim 
)

Definition at line 15 of file triton_utils.cc.

References util::begin(), and util::end().

Referenced by lartriton::TritonClient::TritonClient(), and warnIfError().

16  {
17  if (coll.empty()) return "";
18  using std::begin;
19  using std::end;
20  std::stringstream msg;
21  //avoid trailing delim
22  std::copy(begin(coll), end(coll), std::experimental::make_ostream_joiner(msg, delim));
23  return msg.str();
24  }
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
Definition: StdUtils.h:69
void triton_utils::throwIfError ( const Error err,
std::string_view  msg 
)

Definition at line 26 of file triton_utils.cc.

Referenced by lartriton::TritonData< IO >::fromServer(), lartriton::TritonData< IO >::toServer(), and lartriton::TritonClient::TritonClient().

27  {
28  if (!err.IsOk()) throw cet::exception("TritonServerFailure") << msg << ": " << err;
29  }
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
bool triton_utils::warnIfError ( const Error err,
std::string_view  msg 
)

Definition at line 31 of file triton_utils.cc.

References MF_LOG_WARNING, and printColl().

Referenced by lartriton::TritonClient::evaluate(), lartriton::TritonClient::getResults(), and lartriton::TritonClient::getServerSideStatus().

32  {
33  if (!err.IsOk()) MF_LOG_WARNING("TritonServerWarning") << msg << ": " << err;
34  return err.IsOk();
35  }
#define MF_LOG_WARNING(category)