13#ifndef RooFit_HS3Schema_h
14#define RooFit_HS3Schema_h
45 std::string
path()
const;
46 void error(std::string
const &message)
const;
47 void warning(std::string
const &message)
const;
54 const char *
_key =
nullptr;
71 void operator()(
const char *key, std::optional<T> &field);
75 void list(
const char *key, std::vector<T> &field);
79 void nested(
const char *key, Fn &&fn);
82 bool has(
const char *key);
115 c.error(
"must be an array");
130auto readValue(
Cursor const &
c, T &out) -> std::void_t<decltype(describe(std::declval<Reader &>(), out))>
132 if (!
c.node().is_map()) {
133 c.error(
"must be a struct");
144 _cursor.
error(std::string(
"does not define the required component \"") + key +
"\"");
181 _cursor.
error(std::string(
"does not define the required component \"") + key +
"\"");
185 if (!
child.node().is_map()) {
186 child.error(
"must be a struct");
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t child
size_t num_children() const
A position in the JSON tree.
std::size_t numErrors() const
void warning(std::string const &message) const
Cursor(Detail::JSONNode const &node, Cursor const &parent, std::size_t index)
Detail::JSONNode const & node() const
Cursor(Detail::JSONNode const &node, Diagnostics &diagnostics)
Diagnostics & _diagnostics
Detail::JSONNode const & _node
Cursor(Detail::JSONNode const &node, Cursor const &parent, const char *key)
void error(std::string const &message) const
Reads the components of a struct.
~Reader()
Reports the components that were not read, unless reading the struct gave an error.
Reader(Cursor const &cursor)
bool has(const char *key)
Whether the struct has a component. Checking for a component counts as reading it.
std::vector< std::string > _seen
void operator()(const char *key, T &field)
Read a required component, or an optional one if the field is a std::optional.
void nested(const char *key, Fn &&fn)
Read the components of a struct that is nested in a component.
std::size_t _nErrorsBefore
Cursor const & cursor() const
Reader & operator=(Reader const &)=delete
void list(const char *key, std::vector< T > &field)
Read an array that can be omitted, which is equivalent to an empty one.
Reader(Reader const &)=delete
Types that represent an HS3 document.
std::variant< std::string, double > NameOrNumber
A name, or a number for a constant.
InterpolationClass
The RooFit classes that implement the interpolations, which encode them with integer codes.
void readValue(Cursor const &c, std::string &out)
void describe(Reader &ar, Package &p)
std::optional< Interpolation > readInterpolationCode(Cursor const &c, InterpolationClass interpolationClass)
Reads an integer interpolation code, as older versions of RooFit wrote them.
std::vector< Diagnostic > Diagnostics
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
How a modifier of a HistFactory distribution interpolates and extrapolates its effect.
A name that says what it refers to, so that for example a DataRef can't be used as a DomainRef.