10#ifndef ROOFIT_ROOFITCORE_INC_VALUECHECKING_H_
11#define ROOFIT_ROOFITCORE_INC_VALUECHECKING_H_
20class CachingError :
public std::exception {
22 CachingError(
const std::string& newMessage)
24 _messages.push_back(newMessage);
27 CachingError(CachingError&& previous,
const std::string& newMessage) :
28 _messages{std::move(previous._messages)}
30 _messages.push_back(newMessage);
33 const char*
what() const noexcept
override {
34 std::stringstream out;
35 out <<
"**Computation/caching error** in\n";
38 for (
auto it = _messages.rbegin(); it != _messages.rend(); ++it) {
39 std::string message = *it;
40 auto pos = message.find(
'\n', 0);
41 while (pos != std::string::npos) {
42 message.insert(pos+1,
indent);
43 pos = (message.find(
'\n', pos+1));
46 out <<
indent << message <<
"\n";
52 std::string*
ret =
new std::string(out.str());
59 std::vector<std::string> _messages;
66 typename std::enable_if<std::is_base_of<RooAbsArg, T>::value>::type* =
nullptr >
68 _stream << arg.ClassName() <<
"::" << arg.GetName() <<
" " << &arg <<
" ";
69 arg.printArgs(_stream);
74 typename std::enable_if< ! std::is_base_of<RooAbsArg, T>::value>::type* =
nullptr >
80 operator std::string()
const {
84 std::ostream& stream() {
89 std::ostringstream _stream;
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
static void indent(ostringstream &buf, int indent_level)