13#ifndef RooFit_HS3Schema_h
14#define RooFit_HS3Schema_h
44 std::string
path()
const;
53 const char *
_key =
nullptr;
70 void operator()(
const char *key, std::optional<T> &field);
74 void optional(
const char *key, T &field);
78 void nested(
const char *key, Fn &&fn);
81 bool has(
const char *key);
117 if (!
c.node().is_null()) {
127 c.error(
"must be an array");
144 if (!
c.node().is_map()) {
145 c.error(
"must be a struct");
149 const std::string key = item.key();
156auto readValue(
Cursor const &
c, T &out) -> std::void_t<decltype(describe(std::declval<Reader &>(), out))>
158 if (!
c.node().is_map()) {
159 c.error(
"must be a struct");
170 _cursor.
error(std::string(
"does not define the required component \"") + key +
"\"");
196 _cursor.
error(std::string(
"does not define the required component \"") + key +
"\"");
200 if (!
c.node().is_map()) {
201 c.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.
void ignoreUnread()
Don't report the components that were not read, because they are read later by someone else.
~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 optional(const char *key, T &field)
Read a component that can be omitted or null, which leaves the field as it is, e.g....
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
Reader(Reader const &)=delete
Cursor child(const char *key) const
The position of a component.
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.