Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RYMLParser.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Carsten D. Burgard, DESY/ATLAS, Dec 2021
5 *
6 * Copyright (c) 2022, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef RYML_PARSER_H
14#define RYML_PARSER_H
15
17
18#include <RConfigure.h>
19
20#include <list>
21#include <istream>
22#include <memory>
23
25protected:
26 class Impl;
27 std::unique_ptr<Impl> tree;
28
29public:
31 protected:
33 class Impl;
34 friend TRYMLTree;
35 std::unique_ptr<Impl> node;
36
37 public:
38 void writeJSON(std::ostream &os) const override;
39 void writeYML(std::ostream &) const override;
40
41 Node(TRYMLTree *t, const Impl &other);
42 Node(const Node &other);
43 Node &operator<<(std::string const &s) override;
44 Node &operator<<(int i) override;
45 Node &operator<<(double d) override;
46 Node &operator<<(bool b) override;
47 const Node &operator>>(std::string &v) const override;
48 Node &operator[](std::string const &k) override;
49 const Node &operator[](std::string const &k) const override;
50 bool is_container() const override;
51 bool is_map() const override;
52 bool is_seq() const override;
53 Node &set_map() override;
54 Node &set_seq() override;
55 void clear() override;
56 std::string key() const override;
57 std::string val() const override;
58 bool has_key() const override;
59 bool has_val() const override;
60 bool has_child(std::string const &) const override;
61 Node &append_child() override;
62 size_t num_children() const override;
63 Node &child(size_t pos) override;
64 const Node &child(size_t pos) const override;
65 };
66
67protected:
68 std::list<std::string> _strcache;
69 std::list<Node> _nodecache;
70
71public:
72 Node &incache(const Node &n);
73 const char *incache(const std::string &str);
74 void clearcache();
75
76public:
77 TRYMLTree();
78 ~TRYMLTree() override;
79 TRYMLTree(std::istream &is);
80 Node &rootnode() override;
81};
82
83#endif
#define d(i)
Definition RSha256.hxx:102
#define b(i)
Definition RSha256.hxx:100
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
bool is_map() const override
bool has_key() const override
const Node & operator>>(std::string &v) const override
void writeYML(std::ostream &) const override
TRYMLTree * tree
Definition RYMLParser.h:32
bool is_container() const override
void clear() override
std::string key() const override
Node & set_map() override
Node & operator<<(std::string const &s) override
std::unique_ptr< Impl > node
Definition RYMLParser.h:35
std::string val() const override
Node & operator[](std::string const &k) override
Node & append_child() override
bool is_seq() const override
bool has_val() const override
bool has_child(std::string const &) const override
void writeJSON(std::ostream &os) const override
size_t num_children() const override
Node & set_seq() override
std::unique_ptr< Impl > tree
Definition RYMLParser.h:27
std::list< std::string > _strcache
Definition RYMLParser.h:68
~TRYMLTree() override
void clearcache()
Node & incache(const Node &n)
Node & rootnode() override
std::list< Node > _nodecache
Definition RYMLParser.h:69
const Int_t n
Definition legend1.C:16