Logo ROOT  
Reference Guide
TRootSniffer.h
Go to the documentation of this file.
1 // $Id$
2 // Author: Sergey Linev 22/12/2013
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TRootSniffer
13 #define ROOT_TRootSniffer
14 
15 #include "TNamed.h"
16 #include "TList.h"
17 #include <memory>
18 #include <string>
19 
20 class TFolder;
21 class TKey;
22 class TBufferFile;
23 class TDataMember;
24 class THttpCallArg;
25 class TRootSnifferStore;
26 class TRootSniffer;
27 
29 
30  friend class TRootSniffer;
31 
32 protected:
33  // different bits used to scan hierarchy
34  enum {
35  kScan = 0x0001, ///< normal scan of hierarchy
36  kExpand = 0x0002, ///< expand of specified item - allowed to scan object members
37  kSearch = 0x0004, ///< search for specified item (only objects and collections)
38  kCheckChilds = 0x0008, ///< check if there childs, very similar to search
39  kOnlyFields = 0x0010, ///< if set, only fields for specified item will be set (but all fields)
40  kActions = 0x001F ///< mask for actions, only actions copied to child rec
41  };
42 
43  TRootSnifferScanRec *fParent{nullptr}; ///<! pointer on parent record
44  UInt_t fMask{0}; ///<! defines operation kind
45  const char *fSearchPath{nullptr}; ///<! current path searched
46  Int_t fLevel{0}; ///<! current level of hierarchy
47  TString fItemName; ///<! name of current item
48  TList fItemsNames; ///<! list of created items names, need to avoid duplication
49  Int_t fRestriction{0}; ///<! restriction 0 - default, 1 - read-only, 2 - full access
50 
51  TRootSnifferStore *fStore{nullptr}; ///<! object to store results
52  Bool_t fHasMore{kFALSE}; ///<! indicates that potentially there are more items can be found
53  Bool_t fNodeStarted{kFALSE}; ///<! indicate if node was started
54  Int_t fNumFields{0}; ///<! number of fields
55  Int_t fNumChilds{0}; ///<! number of childs
56 
57 public:
59  virtual ~TRootSnifferScanRec();
60 
61  void CloseNode();
62 
63  /** return true when fields could be set to the hierarchy item */
64  Bool_t CanSetFields() const { return (fMask & kScan) && (fStore != nullptr); }
65 
66  /** return true when only fields are scanned by the sniffer */
67  Bool_t ScanOnlyFields() const { return (fMask & kOnlyFields) && (fMask & kScan); }
68 
69  /** Starts new node, must be closed at the end */
70  void CreateNode(const char *_node_name);
71 
72  void BeforeNextChild();
73 
74  /** Set item field only when creating is specified */
75  void SetField(const char *name, const char *value, Bool_t with_quotes = kTRUE);
76 
77  /** Mark item with ROOT class and correspondent streamer info */
78  void SetRootClass(TClass *cl);
79 
80  /** Returns true when item can be expanded */
82 
83  /** Checks if result will be accepted. Used to verify if sniffer should read object from the file */
84  Bool_t IsReadyForResult() const;
85 
86  /** Obsolete, use SetFoundResult instead */
87  Bool_t SetResult(void *obj, TClass *cl, TDataMember *member = nullptr);
88 
89  /** Set found element with class and datamember (optional) */
90  Bool_t SetFoundResult(void *obj, TClass *cl, TDataMember *member = nullptr);
91 
92  /** Returns depth of hierarchy */
93  Int_t Depth() const;
94 
95  /** Method indicates that scanning can be interrupted while result is set */
96  Bool_t Done() const;
97 
98  /** Construct item name, using object name as basis */
99  void MakeItemName(const char *objname, TString &itemname);
100 
101  /** Produces full name for the current item */
102  void BuildFullName(TString &buf, TRootSnifferScanRec *prnt = nullptr);
103 
104  /** Returns read-only flag for current item */
105  Bool_t IsReadOnly(Bool_t dflt = kTRUE);
106 
107  Bool_t GoInside(TRootSnifferScanRec &super, TObject *obj, const char *obj_name = nullptr,
108  TRootSniffer *sniffer = nullptr);
109 
110  ClassDef(TRootSnifferScanRec, 0) // Scan record for objects sniffer
111 };
112 
113 //_______________________________________________________________________
114 
115 class TRootSniffer : public TNamed {
116  enum {
117  kItemField = BIT(21) // item property stored as TNamed
118  };
119 
120 protected:
121  TString fObjectsPath; ///<! default path for registered objects
122  Bool_t fReadOnly{kTRUE}; ///<! indicate if sniffer allowed to change ROOT structures - like read objects from file
123  Bool_t fScanGlobalDir{kTRUE}; ///<! when enabled (default), scan gROOT for histograms, canvases, open files
124  std::unique_ptr<TFolder> fTopFolder; ///<! own top TFolder object, used for registering objects
125  THttpCallArg *fCurrentArg{nullptr}; ///<! current http arguments (if any)
126  Int_t fCurrentRestrict{0}; ///<! current restriction for last-found object
127  TString fCurrentAllowedMethods; ///<! list of allowed methods, extracted when analyzed object restrictions
128  TList fRestrictions; ///<! list of restrictions for different locations
129  TString fAutoLoad; ///<! scripts names, which are add as _autoload parameter to h.json request
130 
131  void ScanObjectMembers(TRootSnifferScanRec &rec, TClass *cl, char *ptr);
132 
133  virtual void ScanObjectProperties(TRootSnifferScanRec &rec, TObject *obj);
134 
135  virtual void ScanKeyProperties(TRootSnifferScanRec &rec, TKey *key, TObject *&obj, TClass *&obj_class);
136 
137  virtual void ScanObjectChilds(TRootSnifferScanRec &rec, TObject *obj);
138 
139  void
140  ScanCollection(TRootSnifferScanRec &rec, TCollection *lst, const char *foldername = nullptr, TCollection *keys_lst = nullptr);
141 
142  virtual void ScanRoot(TRootSnifferScanRec &rec);
143 
144  TString DecodeUrlOptionValue(const char *value, Bool_t remove_quotes = kTRUE);
145 
146  TObject *GetItem(const char *fullname, TFolder *&parent, Bool_t force = kFALSE, Bool_t within_objects = kTRUE);
147 
148  TFolder *GetSubFolder(const char *foldername, Bool_t force = kFALSE);
149 
150  const char *GetItemField(TFolder *parent, TObject *item, const char *name);
151 
152  Bool_t IsItemField(TObject *obj) const;
153 
154  Bool_t AccessField(TFolder *parent, TObject *item, const char *name, const char *value, TNamed **only_get = nullptr);
155 
156  Int_t WithCurrentUserName(const char *option);
157 
158  virtual Bool_t CanDrawClass(TClass *) { return kFALSE; }
159 
160  virtual Bool_t HasStreamerInfo() const { return kFALSE; }
161 
162  virtual Bool_t ProduceJson(const std::string &path, const std::string &options, std::string &res);
163 
164  virtual Bool_t ProduceXml(const std::string &path, const std::string &options, std::string &res);
165 
166  virtual Bool_t ProduceBinary(const std::string &path, const std::string &options, std::string &res);
167 
168  virtual Bool_t ProduceImage(Int_t kind, const std::string &path, const std::string &options, std::string &res);
169 
170  virtual Bool_t ProduceExe(const std::string &path, const std::string &options, Int_t reskind, std::string &res);
171 
172  virtual Bool_t ExecuteCmd(const std::string &path, const std::string &options, std::string &res);
173 
174  virtual Bool_t
175  ProduceItem(const std::string &path, const std::string &options, std::string &res, Bool_t asjson = kTRUE);
176 
177  virtual Bool_t
178  ProduceMulti(const std::string &path, const std::string &options, std::string &res, Bool_t asjson = kTRUE);
179 
180 public:
181  TRootSniffer(const char *name, const char *objpath = "Objects");
182  virtual ~TRootSniffer();
183 
184  /** When readonly on (default), sniffer is not allowed to change ROOT structures
185  * For instance, it is not allowed to read new objects from files */
186  void SetReadOnly(Bool_t on = kTRUE) { fReadOnly = on; }
187 
188  /** Returns readonly mode */
189  Bool_t IsReadOnly() const { return fReadOnly; }
190 
191  void Restrict(const char *path, const char *options);
192 
193  Bool_t HasRestriction(const char *item_name);
194 
195  Int_t CheckRestriction(const char *item_name);
196 
197  void CreateOwnTopFolder();
198 
199  TFolder *GetTopFolder(Bool_t force = kFALSE);
200 
201  /** When enabled (default), sniffer scans gROOT for files, canvases, histograms */
203 
204  void SetAutoLoad(const char *scripts = "");
205 
206  const char *GetAutoLoad() const;
207 
208  /** Returns true when sniffer allowed to scan global directories */
210 
211  Bool_t RegisterObject(const char *subfolder, TObject *obj);
212 
214 
215  Bool_t RegisterCommand(const char *cmdname, const char *method, const char *icon);
216 
217  Bool_t CreateItem(const char *fullname, const char *title);
218 
219  Bool_t SetItemField(const char *fullname, const char *name, const char *value);
220 
221  const char *GetItemField(const char *fullname, const char *name);
222 
223  void SetCurrentCallArg(THttpCallArg *arg);
224 
225  /** Method scans normal objects, registered in ROOT */
226  void ScanHierarchy(const char *topname, const char *path, TRootSnifferStore *store, Bool_t only_fields = kFALSE);
227 
228  TObject *FindTObjectInHierarchy(const char *path);
229 
230  virtual void *
231  FindInHierarchy(const char *path, TClass **cl = nullptr, TDataMember **member = nullptr, Int_t *chld = nullptr);
232 
233  Bool_t CanDrawItem(const char *path);
234 
235  Bool_t CanExploreItem(const char *path);
236 
237  virtual Bool_t IsStreamerInfoItem(const char *) { return kFALSE; }
238 
239  virtual ULong_t GetStreamerInfoHash() { return 0; }
240 
241  virtual ULong_t GetItemHash(const char *itemname);
242 
243  Bool_t Produce(const std::string &path, const std::string &file, const std::string &options, std::string &res);
244 
245  ClassDef(TRootSniffer, 0) // Sniffer of ROOT objects (basic version)
246 };
247 
248 #endif
TRootSnifferScanRec::BuildFullName
void BuildFullName(TString &buf, TRootSnifferScanRec *prnt=nullptr)
Produces full name for the current item.
Definition: TRootSniffer.cxx:122
TRootSniffer::ProduceBinary
virtual Bool_t ProduceBinary(const std::string &path, const std::string &options, std::string &res)
Produce binary data for specified item if "zipped" option specified in query, buffer will be compress...
Definition: TRootSniffer.cxx:1433
TRootSniffer::SetCurrentCallArg
void SetCurrentCallArg(THttpCallArg *arg)
set current http arguments, which then used in different process methods For instance,...
Definition: TRootSniffer.cxx:438
TRootSniffer::fCurrentArg
THttpCallArg * fCurrentArg
! current http arguments (if any)
Definition: TRootSniffer.h:125
TRootSnifferScanRec::fMask
UInt_t fMask
! defines operation kind
Definition: TRootSniffer.h:44
TRootSniffer::HasRestriction
Bool_t HasRestriction(const char *item_name)
Made fast check if item with specified name is in restriction list If returns true,...
Definition: TRootSniffer.cxx:495
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TRootSnifferScanRec::SetRootClass
void SetRootClass(TClass *cl)
Mark item with ROOT class and correspondent streamer info.
Definition: TRootSniffer.cxx:172
TRootSniffer::CreateOwnTopFolder
void CreateOwnTopFolder()
Create own TFolder structures independent from gROOT This allows to have many independent TRootSniffe...
Definition: TRootSniffer.cxx:911
TRootSniffer::ProduceExe
virtual Bool_t ProduceExe(const std::string &path, const std::string &options, Int_t reskind, std::string &res)
Execute command for specified object Options include method and extra list of parameters sniffer shou...
Definition: TRootSniffer.cxx:1312
TRootSnifferScanRec::fItemName
TString fItemName
! name of current item
Definition: TRootSniffer.h:47
TRootSnifferScanRec::fHasMore
Bool_t fHasMore
! indicates that potentially there are more items can be found
Definition: TRootSniffer.h:52
TRootSniffer::ScanRoot
virtual void ScanRoot(TRootSnifferScanRec &rec)
scan complete ROOT objects hierarchy For the moment it includes objects in gROOT directory and list o...
Definition: TRootSniffer.cxx:963
TRootSniffer::CheckRestriction
Int_t CheckRestriction(const char *item_name)
Checked if restriction is applied to the item full_item_name should have full path to the item.
Definition: TRootSniffer.cxx:542
TRootSnifferScanRec::fNumChilds
Int_t fNumChilds
! number of childs
Definition: TRootSniffer.h:55
TRootSniffer::TRootSniffer
TRootSniffer(const char *name, const char *objpath="Objects")
constructor
Definition: TRootSniffer.cxx:419
TFolder
A TFolder object is a collection of objects and folders.
Definition: TFolder.h:30
TRootSniffer::GetItem
TObject * GetItem(const char *fullname, TFolder *&parent, Bool_t force=kFALSE, Bool_t within_objects=kTRUE)
return item from the subfolders structure
Definition: TRootSniffer.cxx:1534
TRootSnifferScanRec::kScan
@ kScan
normal scan of hierarchy
Definition: TRootSniffer.h:35
TRootSniffer::ProduceJson
virtual Bool_t ProduceJson(const std::string &path, const std::string &options, std::string &res)
Produce JSON data for specified item For object conversion TBufferJSON is used.
Definition: TRootSniffer.cxx:1129
TRootSnifferStore
Abstract interface for storage of hierarchy scan in TRootSniffer.
Definition: TRootSnifferStore.h:24
TRootSniffer::GetSubFolder
TFolder * GetSubFolder(const char *foldername, Bool_t force=kFALSE)
creates subfolder where objects can be registered
Definition: TRootSniffer.cxx:1585
TNamed.h
TRootSniffer::IsScanGlobalDir
Bool_t IsScanGlobalDir() const
Returns true when sniffer allowed to scan global directories.
Definition: TRootSniffer.h:209
TRootSniffer::ProduceImage
virtual Bool_t ProduceImage(Int_t kind, const std::string &path, const std::string &options, std::string &res)
Method to produce image from specified object.
Definition: TRootSniffer.cxx:1459
TRootSnifferScanRec::kSearch
@ kSearch
search for specified item (only objects and collections)
Definition: TRootSniffer.h:37
TRootSniffer::ScanCollection
void ScanCollection(TRootSnifferScanRec &rec, TCollection *lst, const char *foldername=nullptr, TCollection *keys_lst=nullptr)
scan collection content
Definition: TRootSniffer.cxx:773
TRootSniffer::fObjectsPath
TString fObjectsPath
! default path for registered objects
Definition: TRootSniffer.h:121
TRootSniffer::CanDrawClass
virtual Bool_t CanDrawClass(TClass *)
Definition: TRootSniffer.h:158
TRootSniffer::CanExploreItem
Bool_t CanExploreItem(const char *path)
Method returns true when object has childs or one could try to expand item.
Definition: TRootSniffer.cxx:1117
Int_t
int Int_t
Definition: RtypesCore.h:45
TDataMember
All ROOT classes may have RTTI (run time type identification) support added.
Definition: TDataMember.h:31
TRootSnifferScanRec::GoInside
Bool_t GoInside(TRootSnifferScanRec &super, TObject *obj, const char *obj_name=nullptr, TRootSniffer *sniffer=nullptr)
Method verifies if new level of hierarchy should be started with provided object.
Definition: TRootSniffer.cxx:303
TRootSniffer::IsReadOnly
Bool_t IsReadOnly() const
Returns readonly mode.
Definition: TRootSniffer.h:189
THttpCallArg
Definition: THttpCallArg.h:27
TRootSniffer::fRestrictions
TList fRestrictions
! list of restrictions for different locations
Definition: TRootSniffer.h:128
TList.h
TRootSnifferScanRec::Depth
Int_t Depth() const
Returns depth of hierarchy.
Definition: TRootSniffer.cxx:253
TRootSnifferScanRec::CreateNode
void CreateNode(const char *_node_name)
Starts new node, must be closed at the end.
Definition: TRootSniffer.cxx:142
TRootSnifferScanRec::SetField
void SetField(const char *name, const char *value, Bool_t with_quotes=kTRUE)
Set item field only when creating is specified.
Definition: TRootSniffer.cxx:76
TRootSnifferScanRec::ScanOnlyFields
Bool_t ScanOnlyFields() const
return true when only fields are scanned by the sniffer
Definition: TRootSniffer.h:67
TRootSniffer::DecodeUrlOptionValue
TString DecodeUrlOptionValue(const char *value, Bool_t remove_quotes=kTRUE)
method replaces all kind of special symbols, which could appear in URL options
Definition: TRootSniffer.cxx:1279
TRootSniffer::Produce
Bool_t Produce(const std::string &path, const std::string &file, const std::string &options, std::string &res)
Method produce different kind of data out of object Parameter 'path' specifies object or object membe...
Definition: TRootSniffer.cxx:1480
TRootSniffer::IsItemField
Bool_t IsItemField(TObject *obj) const
return true when object is TNamed with kItemField bit set such objects used to keep field values for ...
Definition: TRootSniffer.cxx:1668
TRootSniffer::GetItemHash
virtual ULong_t GetItemHash(const char *itemname)
Get hash function for specified item used to detect any changes in the specified object.
Definition: TRootSniffer.cxx:1096
TRootSniffer::fCurrentRestrict
Int_t fCurrentRestrict
! current restriction for last-found object
Definition: TRootSniffer.h:126
TString
Basic string class.
Definition: TString.h:136
TRootSniffer::RegisterCommand
Bool_t RegisterCommand(const char *cmdname, const char *method, const char *icon)
Register command which can be executed from web interface.
Definition: TRootSniffer.cxx:1835
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TRootSniffer::AccessField
Bool_t AccessField(TFolder *parent, TObject *item, const char *name, const char *value, TNamed **only_get=nullptr)
set or get field for the child each field coded as TNamed object, placed after chld in the parent hie...
Definition: TRootSniffer.cxx:1677
TRootSniffer::WithCurrentUserName
Int_t WithCurrentUserName(const char *option)
return 2 when option match to current user name return 1 when option==all return 0 when option does n...
Definition: TRootSniffer.cxx:508
TRootSnifferScanRec::kCheckChilds
@ kCheckChilds
check if there childs, very similar to search
Definition: TRootSniffer.h:38
bool
TRootSniffer::kItemField
@ kItemField
Definition: TRootSniffer.h:117
TRootSnifferScanRec::fNumFields
Int_t fNumFields
! number of fields
Definition: TRootSniffer.h:54
TRootSniffer::ExecuteCmd
virtual Bool_t ExecuteCmd(const std::string &path, const std::string &options, std::string &res)
Execute command marked as _kind=='Command'.
Definition: TRootSniffer.cxx:1161
TRootSniffer::ScanKeyProperties
virtual void ScanKeyProperties(TRootSnifferScanRec &rec, TKey *key, TObject *&obj, TClass *&obj_class)
scans key properties in special cases load objects from the file
Definition: TRootSniffer.cxx:737
TRootSnifferScanRec::BeforeNextChild
void BeforeNextChild()
indicates that new child for current element will be started
Definition: TRootSniffer.cxx:86
TRootSnifferScanRec
Definition: TRootSniffer.h:28
TRootSniffer::ProduceMulti
virtual Bool_t ProduceMulti(const std::string &path, const std::string &options, std::string &res, Bool_t asjson=kTRUE)
Process several requests, packing all results into binary or JSON buffer Input parameters should be c...
Definition: TRootSniffer.cxx:1332
TRootSniffer::GetTopFolder
TFolder * GetTopFolder(Bool_t force=kFALSE)
Returns top TFolder instance for the sniffer.
Definition: TRootSniffer.cxx:930
TRootSnifferScanRec::Done
Bool_t Done() const
Method indicates that scanning can be interrupted while result is set.
Definition: TRootSniffer.cxx:182
TRootSnifferScanRec::CanSetFields
Bool_t CanSetFields() const
return true when fields could be set to the hierarchy item
Definition: TRootSniffer.h:64
TRootSnifferScanRec::kExpand
@ kExpand
expand of specified item - allowed to scan object members
Definition: TRootSniffer.h:36
TRootSniffer::fCurrentAllowedMethods
TString fCurrentAllowedMethods
! list of allowed methods, extracted when analyzed object restrictions
Definition: TRootSniffer.h:127
TRootSniffer::fTopFolder
std::unique_ptr< TFolder > fTopFolder
! own top TFolder object, used for registering objects
Definition: TRootSniffer.h:124
TRootSnifferScanRec::fLevel
Int_t fLevel
! current level of hierarchy
Definition: TRootSniffer.h:46
TNamed
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TRootSniffer::fAutoLoad
TString fAutoLoad
! scripts names, which are add as _autoload parameter to h.json request
Definition: TRootSniffer.h:129
TRootSniffer::fScanGlobalDir
Bool_t fScanGlobalDir
! when enabled (default), scan gROOT for histograms, canvases, open files
Definition: TRootSniffer.h:123
TRootSnifferScanRec::IsReadyForResult
Bool_t IsReadyForResult() const
Checks if result will be accepted.
Definition: TRootSniffer.cxx:200
TRootSnifferScanRec::TRootSnifferScanRec
TRootSnifferScanRec()
constructor
Definition: TRootSniffer.cxx:60
TRootSnifferScanRec::CloseNode
void CloseNode()
close started node
Definition: TRootSniffer.cxx:159
TRootSnifferScanRec::SetFoundResult
Bool_t SetFoundResult(void *obj, TClass *cl, TDataMember *member=nullptr)
Set found element with class and datamember (optional)
Definition: TRootSniffer.cxx:237
TRootSnifferScanRec::fRestriction
Int_t fRestriction
! restriction 0 - default, 1 - read-only, 2 - full access
Definition: TRootSniffer.h:49
BIT
#define BIT(n)
Definition: Rtypes.h:85
TRootSnifferScanRec::fItemsNames
TList fItemsNames
! list of created items names, need to avoid duplication
Definition: TRootSniffer.h:48
TRootSnifferScanRec::SetResult
Bool_t SetResult(void *obj, TClass *cl, TDataMember *member=nullptr)
Obsolete, use SetFoundResult instead.
Definition: TRootSniffer.cxx:223
TRootSniffer::ScanObjectProperties
virtual void ScanObjectProperties(TRootSnifferScanRec &rec, TObject *obj)
scans object properties here such fields as _autoload or _icon properties depending on class or objec...
Definition: TRootSniffer.cxx:696
ULong_t
unsigned long ULong_t
Definition: RtypesCore.h:55
TRootSniffer::IsStreamerInfoItem
virtual Bool_t IsStreamerInfoItem(const char *)
Definition: TRootSniffer.h:237
TRootSnifferScanRec::fStore
TRootSnifferStore * fStore
! object to store results
Definition: TRootSniffer.h:51
TRootSniffer::SetScanGlobalDir
void SetScanGlobalDir(Bool_t on=kTRUE)
When enabled (default), sniffer scans gROOT for files, canvases, histograms.
Definition: TRootSniffer.h:202
unsigned int
TRootSniffer::ScanObjectChilds
virtual void ScanObjectChilds(TRootSnifferScanRec &rec, TObject *obj)
scans object childs (if any) here one scans collection, branches, trees and so on
Definition: TRootSniffer.cxx:757
TRootSniffer::CreateItem
Bool_t CreateItem(const char *fullname, const char *title)
create item element
Definition: TRootSniffer.cxx:1652
TKey
Book space in a file, create I/O buffers, to fill them, (un)compress them.
Definition: TKey.h:28
TRootSnifferScanRec::fNodeStarted
Bool_t fNodeStarted
! indicate if node was started
Definition: TRootSniffer.h:53
TRootSnifferScanRec::CanExpandItem
Bool_t CanExpandItem()
Returns true when item can be expanded.
Definition: TRootSniffer.cxx:269
TRootSniffer::~TRootSniffer
virtual ~TRootSniffer()
destructor
Definition: TRootSniffer.cxx:428
TRootSniffer::SetReadOnly
void SetReadOnly(Bool_t on=kTRUE)
When readonly on (default), sniffer is not allowed to change ROOT structures For instance,...
Definition: TRootSniffer.h:186
TRootSnifferScanRec::fParent
TRootSnifferScanRec * fParent
! pointer on parent record
Definition: TRootSniffer.h:43
TRootSniffer::GetAutoLoad
const char * GetAutoLoad() const
return name of configured autoload scripts (or 0)
Definition: TRootSniffer.cxx:486
TRootSniffer::ScanObjectMembers
void ScanObjectMembers(TRootSnifferScanRec &rec, TClass *cl, char *ptr)
scan object data members some members like enum or static members will be excluded
Definition: TRootSniffer.cxx:605
TRootSniffer::SetItemField
Bool_t SetItemField(const char *fullname, const char *name, const char *value)
set field for specified item
Definition: TRootSniffer.cxx:1755
TRootSniffer::FindInHierarchy
virtual void * FindInHierarchy(const char *path, TClass **cl=nullptr, TDataMember **member=nullptr, Int_t *chld=nullptr)
Search element with specified path Returns pointer on element Optionally one could obtain element cla...
Definition: TRootSniffer.cxx:1038
TRootSniffer::GetItemField
const char * GetItemField(TFolder *parent, TObject *item, const char *name)
return field for specified item
Definition: TRootSniffer.cxx:1780
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
file
Definition: file.py:1
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TRootSniffer::UnregisterObject
Bool_t UnregisterObject(TObject *obj)
unregister (remove) object from folders structures folder itself will remain even when it will be emp...
Definition: TRootSniffer.cxx:1631
TRootSnifferScanRec::MakeItemName
void MakeItemName(const char *objname, TString &itemname)
Construct item name, using object name as basis.
Definition: TRootSniffer.cxx:99
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TRootSniffer::ScanHierarchy
void ScanHierarchy(const char *topname, const char *path, TRootSnifferStore *store, Bool_t only_fields=kFALSE)
Method scans normal objects, registered in ROOT.
Definition: TRootSniffer.cxx:998
TRootSniffer::fReadOnly
Bool_t fReadOnly
! indicate if sniffer allowed to change ROOT structures - like read objects from file
Definition: TRootSniffer.h:122
name
char name[80]
Definition: TGX11.cxx:110
TRootSnifferScanRec::IsReadOnly
Bool_t IsReadOnly(Bool_t dflt=kTRUE)
Returns read-only flag for current item.
Definition: TRootSniffer.cxx:288
TRootSniffer::RegisterObject
Bool_t RegisterObject(const char *subfolder, TObject *obj)
Register object in subfolder structure subfolder parameter can have many levels like:
Definition: TRootSniffer.cxx:1613
TRootSniffer
Definition: TRootSniffer.h:115
TRootSniffer::GetStreamerInfoHash
virtual ULong_t GetStreamerInfoHash()
Definition: TRootSniffer.h:239
TRootSniffer::ProduceXml
virtual Bool_t ProduceXml(const std::string &path, const std::string &options, std::string &res)
Produce XML data for specified item For object conversion TBufferXML is used.
Definition: TRootSniffer.cxx:1271
TRootSnifferScanRec::kActions
@ kActions
mask for actions, only actions copied to child rec
Definition: TRootSniffer.h:40
TCollection
Collection abstract base class.
Definition: TCollection.h:63
TRootSniffer::Restrict
void Restrict(const char *path, const char *options)
Restrict access to the specified location.
Definition: TRootSniffer.cxx:462
TRootSniffer::ProduceItem
virtual Bool_t ProduceItem(const std::string &path, const std::string &options, std::string &res, Bool_t asjson=kTRUE)
Produce JSON/XML for specified item contrary to h.json request, only fields for specified item are st...
Definition: TRootSniffer.cxx:1251
TRootSniffer::HasStreamerInfo
virtual Bool_t HasStreamerInfo() const
Definition: TRootSniffer.h:160
TRootSnifferScanRec::kOnlyFields
@ kOnlyFields
if set, only fields for specified item will be set (but all fields)
Definition: TRootSniffer.h:39
TBufferFile
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket.
Definition: TBufferFile.h:47
TRootSnifferScanRec::~TRootSnifferScanRec
virtual ~TRootSnifferScanRec()
destructor
Definition: TRootSniffer.cxx:68
TList
A doubly linked list.
Definition: TList.h:44
TRootSniffer::CanDrawItem
Bool_t CanDrawItem(const char *path)
Method verifies if object can be drawn.
Definition: TRootSniffer.cxx:1106
TRootSniffer::FindTObjectInHierarchy
TObject * FindTObjectInHierarchy(const char *path)
Search element in hierarchy, derived from TObject.
Definition: TRootSniffer.cxx:1083
int
TRootSniffer::SetAutoLoad
void SetAutoLoad(const char *scripts="")
When specified, _autoload attribute will be always add to top element of h.json/h....
Definition: TRootSniffer.cxx:478
TRootSnifferScanRec::fSearchPath
const char * fSearchPath
! current path searched
Definition: TRootSniffer.h:45