ROOT » NET » HTTP » TRootSniffer

class TRootSniffer: public TNamed


TRootSnifferScanRec

Structure used to scan hierarchies of ROOT objects
Represents single level of hierarchy


Function Members (Methods)

public:
virtual~TRootSniffer()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
Bool_tCanDrawItem(const char* path)
Bool_tCanExploreItem(const char* path)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual void*FindInHierarchy(const char* path, TClass** cl = 0, TDataMember** member = 0, Int_t* chld = 0)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
TObject*FindTObjectInHierarchy(const char* path)
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
ULong_tGetItemHash(const char* itemname)
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
ULong_tGetStreamerInfoHash()
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTNamed::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
static Bool_tIsDrawableClass(TClass* cl)
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsReadOnly() const
virtual Bool_tTNamed::IsSortable() const
Bool_tIsStreamerInfoItem(const char* itemname)
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TRootSniffer&operator=(const TRootSniffer&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTNamed::Print(Option_t* option = "") const
Bool_tProduce(const char* path, const char* file, const char* options, void*& ptr, Long_t& length)
Bool_tProduceBinary(const char* path, const char* options, void*& ptr, Long_t& length)
Bool_tProduceExe(const char* path, const char* options, TString& res, Bool_t astxt = kFALSE)
Bool_tProduceImage(Int_t kind, const char* path, const char* options, void*& ptr, Long_t& length)
Bool_tProduceJson(const char* path, const char* options, TString& res)
Bool_tProduceXml(const char* path, const char* options, TString& res)
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
Bool_tRegisterObject(const char* subfolder, TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidScanHierarchy(const char* topname, const char* path, TRootSnifferStore* store)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetReadOnly(Bool_t on = kTRUE)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TRootSniffer(const TRootSniffer&)
TRootSniffer(const char* name, const char* objpath = "online")
Bool_tUnregisterObject(TObject* obj)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
voidCreateMemFile()
TStringDecodeUrlOptionValue(const char* value, Bool_t remove_quotes = kTRUE)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
voidScanCollection(TRootSnifferScanRec& rec, TCollection* lst, const char* foldername = 0, Bool_t extra = kFALSE, TCollection* keys_lst = 0)
voidScanObject(TRootSnifferScanRec& rec, TObject* obj)
virtual voidScanObjectChilds(TRootSnifferScanRec& rec, TObject* obj)
voidScanObjectMemebers(TRootSnifferScanRec& rec, TClass* cl, char* ptr, unsigned long cloffset)
virtual voidScanObjectProperties(TRootSnifferScanRec& rec, TObject*& obj, TClass*& obj_class)
virtual voidScanRoot(TRootSnifferScanRec& rec)

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
TMemFile*fMemFile! file used to manage streamer infos
TStringTNamed::fNameobject identifier
TStringfObjectsPath! path for registered objects
Bool_tfReadOnly! indicate if sniffer allowed to change ROOT structures - for instance, read objects from files
Int_tfSinfoSize! number of elements in streamer info, used as version
TStringTNamed::fTitleobject title

Class Charts

Inheritance Chart:
TObject
TNamed
TRootSniffer

Function documentation

TRootSniffer(const char* name, const char* objpath = "online")
 constructor
~TRootSniffer()
 destructor
void ScanObjectMemebers(TRootSnifferScanRec& rec, TClass* cl, char* ptr, unsigned long cloffset)
 scan object data members
 some members like enum or static members will be excluded
void ScanObject(TRootSnifferScanRec& rec, TObject* obj)
 scan object content
 if object is known collection class (like TFolder),
 collection content will be scanned as well
void ScanObjectProperties(TRootSnifferScanRec& rec, TObject*& obj, TClass*& obj_class)
 scans basic object properties
 here such fields as _typename, _title, _more properties can be specified
void ScanObjectChilds(TRootSnifferScanRec& rec, TObject* obj)
 scans object childs (if any)
 here one scans collection, branches, trees and so on
void ScanCollection(TRootSnifferScanRec& rec, TCollection* lst, const char* foldername = 0, Bool_t extra = kFALSE, TCollection* keys_lst = 0)
 scan collection content
void ScanRoot(TRootSnifferScanRec& rec)
 scan complete ROOT objects hierarchy
 For the moment it includes objects in gROOT directory
 and list of canvases and files
 Also all registered objects are included.
 One could reimplement this method to provide alternative
 scan methods or to extend some collection kinds
Bool_t IsDrawableClass(TClass* cl)
 return true if object can be drawn
void ScanHierarchy(const char* topname, const char* path, TRootSnifferStore* store)
 scan ROOT hierarchy with provided store object
void * FindInHierarchy(const char* path, TClass** cl = 0, TDataMember** member = 0, Int_t* chld = 0)
 Search element with specified path
 Returns pointer on element
 Optionally one could obtain element class, member description
 and number of childs. When chld!=0, not only element is searched,
 but also number of childs are counted. When member!=0, any object
 will be scanned for its data members (disregard of extra options)
TObject * FindTObjectInHierarchy(const char* path)
 Search element in hierarchy, derived from TObject
ULong_t GetStreamerInfoHash()
 Returns hash value for streamer infos
 At the moment - just number of items in streamer infos list.
ULong_t GetItemHash(const char* itemname)
 Get hash function for specified item
 used to detect any changes in the specified object
Bool_t CanDrawItem(const char* path)
 Method verifies if object can be drawn
Bool_t CanExploreItem(const char* path)
 Method returns true when object has childs or
 one could try to expand item
void CreateMemFile()
 Creates TMemFile instance, which used for objects streaming
 One could not use TBufferFile directly,
 while one also require streamer infos list
Bool_t ProduceJson(const char* path, const char* options, TString& res)
 produce JSON data for specified item
 For object conversion TBufferJSON is used
Bool_t ProduceXml(const char* path, const char* options, TString& res)
 produce XML data for specified item
 For object conversion TBufferXML is used
TString DecodeUrlOptionValue(const char* value, Bool_t remove_quotes = kTRUE)
 method replaces all kind of special symbols, which could appear in URL options
Bool_t ProduceExe(const char* path, const char* options, TString& res, Bool_t astxt = kFALSE)
 execute command for specified object
 options include method and extra list of parameters
 sniffer should be not-readonly to allow execution of the commands
Bool_t IsStreamerInfoItem(const char* itemname)
 Return true if it is streamer info item name
Bool_t ProduceBinary(const char* path, const char* options, void*& ptr, Long_t& length)
 produce binary data for specified item
 if "zipped" option specified in query, buffer will be compressed
Bool_t ProduceImage(Int_t kind, const char* path, const char* options, void*& ptr, Long_t& length)
 Method to produce image from specified object

 Parameters:
    kind - image kind TImage::kPng, TImage::kJpeg, TImage::kGif
    path - path to object
    options - extra options

 By default, image 300x200 is produced
 In options string one could provide following parameters:
    w - image width
    h - image height
    opt - draw options
  For instance:
     http://localhost:8080/Files/hsimple.root/hpx/get.png?w=500&h=500&opt=lego1

  Return is memory with produced image
  Memory must be released by user with free(ptr) call
Bool_t Produce(const char* path, const char* file, const char* options, void*& ptr, Long_t& length)
 method to produce different kind of binary data
 Supported file (case sensitive):
   "root.bin"  - binary data
   "root.png"  - png image
   "root.jpeg" - jpeg image
   "root.gif"  - gif image
   "root.xml"  - xml representation
   "root.json" - json representation
   "exe.json"  - method execution with json reply
   "exe.txt"   - method execution with debug output
Bool_t RegisterObject(const char* subfolder, TObject* obj)
 register object in subfolder structure
 subfolder parameter can have many levels like:

 TRootSniffer* sniff = new TRootSniffer("sniff");
 sniff->RegisterObject("/my/sub/subfolder", h1);

 Such objects can be later found in "Objects" folder of sniffer like

 h1 = sniff->FindTObjectInHierarchy("/Objects/my/sub/subfolder/h1");

 Objects, registered in "extra" sub-folder, can be explored.
 Typically one used "extra" sub-folder to register event structures to
 be able expand it later in web-browser:

 TEvent* ev = new TEvent;
 sniff->RegisterObject("extra", ev);
Bool_t UnregisterObject(TObject* obj)
 unregister (remove) object from folders structures
 folder itself will remain even when it will be empty
TRootSniffer(const char* name, const char* objpath = "online")
void SetReadOnly(Bool_t on = kTRUE)
 When readonly on (default), sniffer is not allowed to change ROOT structures.
 For instance, it is not allowed to read new objects from files 
{ fReadOnly = on; }
Bool_t IsReadOnly() const
 Return readonly mode 
{ return fReadOnly; }