]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/Tools/AliJSONReader.h
Remove stale email recipient.
[u/mrichter/AliRoot.git] / PWG / Tools / AliJSONReader.h
CommitLineData
c4109efb 1/*
2 * AliJSONReader.h
3 *
4 * Created on: 06.11.2014
5 * Author: markusfasel
6 */
7
8#ifndef _ALIJSONREADER_H_
9#define _ALIJSONREADER_H_
10
11#include "AliJSONData.h"
12#include <string>
13#include <vector>
14
15class TList;
16
17class AliJSONSyntaxTreeNode{
18public:
19 AliJSONSyntaxTreeNode(const char *name, AliJSONSyntaxTreeNode *mother);
20 ~AliJSONSyntaxTreeNode();
21
22 void AddEntry(AliJSONData *entry);
23 AliJSONSyntaxTreeNode *CreateDaughter(const char *name);
24 void SetOwner(bool owner = true);
25 AliJSONSyntaxTreeNode *GetMotherNode() const { return fMotherNode; }
26 std::vector<AliJSONSyntaxTreeNode *> &GetDaughters() { return fDaughters; };
27 std::vector<AliJSONData *> &GetEntries() { return fEntries; }
28 const char *GetName() const { return fName.c_str(); }
29
30private:
31 AliJSONSyntaxTreeNode(const AliJSONSyntaxTreeNode &ref);
32 AliJSONSyntaxTreeNode *operator=(const AliJSONSyntaxTreeNode &ref);
33
34 std::string fName;
35 AliJSONSyntaxTreeNode *fMotherNode;
36 std::vector<AliJSONData *> fEntries;
37 std::vector<AliJSONSyntaxTreeNode *> fDaughters;
38 bool fOwner;
39};
40
41class AliJSONReader {
42public:
43 AliJSONReader();
44 virtual ~AliJSONReader();
45
46 TList *Decode(const char *jsosnstring) const;
47
48private:
49 void AddNodeToList(AliJSONSyntaxTreeNode *node, TList *consumer) const;
50};
51
52#endif /* PWG_EMCAL_ALIEMCALJSONREADER_H_ */