Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TRootSnifferScanRec Class Reference

Structure used to scan hierarchies of ROOT objects.

Represents single level of hierarchy

Definition at line 28 of file TRootSniffer.h.

Public Member Functions

 TRootSnifferScanRec ()
 constructor
 
virtual ~TRootSnifferScanRec ()
 destructor
 
void BeforeNextChild ()
 Indicates that new child for current element will be started.
 
void BuildFullName (TString &buf, TRootSnifferScanRec *prnt=nullptr)
 Produces full name for the current item.
 
Bool_t CanExpandItem ()
 Returns true when item can be expanded.
 
Bool_t CanSetFields () const
 return true when fields could be set to the hierarchy item
 
void CloseNode ()
 Close started node.
 
void CreateNode (const char *_node_name)
 Starts new node, must be closed at the end.
 
Int_t Depth () const
 Returns depth of hierarchy.
 
Bool_t Done () const
 Method indicates that scanning can be interrupted while result is set.
 
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.
 
virtual TClassIsA () const
 
Bool_t IsReadOnly (Bool_t dflt=kTRUE)
 Returns read-only flag for current item.
 
Bool_t IsReadyForResult () const
 Checks if result will be accepted.
 
void MakeItemName (const char *objname, TString &itemname)
 Construct item name, using object name as basis.
 
Bool_t ScanOnlyFields () const
 return true when only fields are scanned by the sniffer
 
void SetField (const char *name, const char *value, Bool_t with_quotes=kTRUE)
 Set item field only when creating is specified.
 
Bool_t SetFoundResult (void *obj, TClass *cl, TDataMember *member=nullptr)
 Set found element with class and datamember (optional)
 
Bool_t SetResult (void *obj, TClass *cl, TDataMember *member=nullptr)
 Obsolete, use SetFoundResult instead.
 
void SetRootClass (TClass *cl)
 Mark item with ROOT class and correspondent streamer info.
 
virtual void Streamer (TBuffer &)
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 

Protected Types

enum  {
  kScan = 0x0001 , kExpand = 0x0002 , kSearch = 0x0004 , kCheckChilds = 0x0008 ,
  kOnlyFields = 0x0010 , kActions = 0x001F
}
 

Protected Attributes

Bool_t fHasMore {kFALSE}
 ! indicates that potentially there are more items can be found
 
TString fItemName
 ! name of current item
 
TList fItemsNames
 ! list of created items names, need to avoid duplication
 
Int_t fLevel {0}
 ! current level of hierarchy
 
UInt_t fMask {0}
 ! defines operation kind
 
Bool_t fNodeStarted {kFALSE}
 ! indicate if node was started
 
Int_t fNumChilds {0}
 ! number of childs
 
Int_t fNumFields {0}
 ! number of fields
 
TRootSnifferScanRecfParent {nullptr}
 ! pointer on parent record
 
Int_t fRestriction {0}
 ! restriction 0 - default, 1 - read-only, 2 - full access
 
const char * fSearchPath {nullptr}
 ! current path searched
 
TRootSnifferStorefStore {nullptr}
 ! object to store results
 

Friends

class TRootSniffer
 

#include <TRootSniffer.h>

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
kScan 

normal scan of hierarchy

kExpand 

expand of specified item - allowed to scan object members

kSearch 

search for specified item (only objects and collections)

kCheckChilds 

check if there childs, very similar to search

kOnlyFields 

if set, only fields for specified item will be set (but all fields)

kActions 

mask for actions, only actions copied to child rec

Definition at line 34 of file TRootSniffer.h.

Constructor & Destructor Documentation

◆ TRootSnifferScanRec()

TRootSnifferScanRec::TRootSnifferScanRec ( )

constructor

Definition at line 58 of file TRootSniffer.cxx.

◆ ~TRootSnifferScanRec()

TRootSnifferScanRec::~TRootSnifferScanRec ( )
virtual

destructor

Definition at line 66 of file TRootSniffer.cxx.

Member Function Documentation

◆ BeforeNextChild()

void TRootSnifferScanRec::BeforeNextChild ( )

Indicates that new child for current element will be started.

Definition at line 84 of file TRootSniffer.cxx.

◆ BuildFullName()

void TRootSnifferScanRec::BuildFullName ( TString buf,
TRootSnifferScanRec prnt = nullptr 
)

Produces full name for the current item.

Produce full name, including all parents.

Definition at line 120 of file TRootSniffer.cxx.

◆ CanExpandItem()

Bool_t TRootSnifferScanRec::CanExpandItem ( )

Returns true when item can be expanded.

returns true if current item can be expanded - means one could explore objects members

Definition at line 267 of file TRootSniffer.cxx.

◆ CanSetFields()

Bool_t TRootSnifferScanRec::CanSetFields ( ) const
inline

return true when fields could be set to the hierarchy item

Definition at line 64 of file TRootSniffer.h.

◆ Class()

static TClass * TRootSnifferScanRec::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TRootSnifferScanRec::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TRootSnifferScanRec::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 110 of file TRootSniffer.h.

◆ CloseNode()

void TRootSnifferScanRec::CloseNode ( )

Close started node.

Definition at line 157 of file TRootSniffer.cxx.

◆ CreateNode()

void TRootSnifferScanRec::CreateNode ( const char *  _node_name)

Starts new node, must be closed at the end.

Creates new node with specified name if special symbols like "[]&<>" are used, node name will be replaced by default name like "extra_item_N" and original node name will be recorded as "_original_name" field Optionally, object name can be recorded as "_realname" field.

Definition at line 140 of file TRootSniffer.cxx.

◆ DeclFileName()

static const char * TRootSnifferScanRec::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 110 of file TRootSniffer.h.

◆ Depth()

Int_t TRootSnifferScanRec::Depth ( ) const

Returns depth of hierarchy.

returns current depth of scanned hierarchy

Definition at line 251 of file TRootSniffer.cxx.

◆ Done()

Bool_t TRootSnifferScanRec::Done ( ) const

Method indicates that scanning can be interrupted while result is set.

returns true if scanning is done Can happen when searched element is found

Definition at line 180 of file TRootSniffer.cxx.

◆ GoInside()

Bool_t TRootSnifferScanRec::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.

If required, all necessary nodes and fields will be created Used when different collection kinds should be scanned

Definition at line 300 of file TRootSniffer.cxx.

◆ IsA()

virtual TClass * TRootSnifferScanRec::IsA ( ) const
inlinevirtual
Returns
TClass describing current object

Definition at line 110 of file TRootSniffer.h.

◆ IsReadOnly()

Bool_t TRootSnifferScanRec::IsReadOnly ( Bool_t  dflt = kTRUE)

Returns read-only flag for current item.

returns read-only flag for current item Depends from default value and current restrictions

Definition at line 286 of file TRootSniffer.cxx.

◆ IsReadyForResult()

Bool_t TRootSnifferScanRec::IsReadyForResult ( ) const

Checks if result will be accepted.

Used to verify if sniffer should read object from the file

Definition at line 198 of file TRootSniffer.cxx.

◆ MakeItemName()

void TRootSnifferScanRec::MakeItemName ( const char *  objname,
TString itemname 
)

Construct item name, using object name as basis.

Constructs item name from object name if special symbols like '/', '#', ':', '&', '?' are used in object name they will be replaced with '_'.

To avoid item name duplication, additional id number can be appended

Definition at line 97 of file TRootSniffer.cxx.

◆ ScanOnlyFields()

Bool_t TRootSnifferScanRec::ScanOnlyFields ( ) const
inline

return true when only fields are scanned by the sniffer

Definition at line 67 of file TRootSniffer.h.

◆ SetField()

void TRootSnifferScanRec::SetField ( const char *  name,
const char *  value,
Bool_t  with_quotes = kTRUE 
)

Set item field only when creating is specified.

record field for current element

Definition at line 74 of file TRootSniffer.cxx.

◆ SetFoundResult()

Bool_t TRootSnifferScanRec::SetFoundResult ( void *  obj,
TClass cl,
TDataMember member = nullptr 
)

Set found element with class and datamember (optional)

set results of scanning when member specified, obj is pointer on object to which member belongs

Definition at line 235 of file TRootSniffer.cxx.

◆ SetResult()

Bool_t TRootSnifferScanRec::SetResult ( void *  obj,
TClass cl,
TDataMember member = nullptr 
)

Obsolete, use SetFoundResult instead.

set results of scanning when member should be specified, use SetFoundResult instead

Definition at line 221 of file TRootSniffer.cxx.

◆ SetRootClass()

void TRootSnifferScanRec::SetRootClass ( TClass cl)

Mark item with ROOT class and correspondent streamer info.

set root class name as node kind in addition, path to master item (streamer info) specified Such master item required to correctly unstream data on JavaScript

Definition at line 170 of file TRootSniffer.cxx.

◆ Streamer()

virtual void TRootSnifferScanRec::Streamer ( TBuffer )
virtual

◆ StreamerNVirtual()

void TRootSnifferScanRec::StreamerNVirtual ( TBuffer ClassDef_StreamerNVirtual_b)
inline

Definition at line 110 of file TRootSniffer.h.

Friends And Related Symbol Documentation

◆ TRootSniffer

friend class TRootSniffer
friend

Definition at line 30 of file TRootSniffer.h.

Member Data Documentation

◆ fHasMore

Bool_t TRootSnifferScanRec::fHasMore {kFALSE}
protected

! indicates that potentially there are more items can be found

Definition at line 52 of file TRootSniffer.h.

◆ fItemName

TString TRootSnifferScanRec::fItemName
protected

! name of current item

Definition at line 47 of file TRootSniffer.h.

◆ fItemsNames

TList TRootSnifferScanRec::fItemsNames
protected

! list of created items names, need to avoid duplication

Definition at line 48 of file TRootSniffer.h.

◆ fLevel

Int_t TRootSnifferScanRec::fLevel {0}
protected

! current level of hierarchy

Definition at line 46 of file TRootSniffer.h.

◆ fMask

UInt_t TRootSnifferScanRec::fMask {0}
protected

! defines operation kind

Definition at line 44 of file TRootSniffer.h.

◆ fNodeStarted

Bool_t TRootSnifferScanRec::fNodeStarted {kFALSE}
protected

! indicate if node was started

Definition at line 53 of file TRootSniffer.h.

◆ fNumChilds

Int_t TRootSnifferScanRec::fNumChilds {0}
protected

! number of childs

Definition at line 55 of file TRootSniffer.h.

◆ fNumFields

Int_t TRootSnifferScanRec::fNumFields {0}
protected

! number of fields

Definition at line 54 of file TRootSniffer.h.

◆ fParent

TRootSnifferScanRec* TRootSnifferScanRec::fParent {nullptr}
protected

! pointer on parent record

Definition at line 43 of file TRootSniffer.h.

◆ fRestriction

Int_t TRootSnifferScanRec::fRestriction {0}
protected

! restriction 0 - default, 1 - read-only, 2 - full access

Definition at line 49 of file TRootSniffer.h.

◆ fSearchPath

const char* TRootSnifferScanRec::fSearchPath {nullptr}
protected

! current path searched

Definition at line 45 of file TRootSniffer.h.

◆ fStore

TRootSnifferStore* TRootSnifferScanRec::fStore {nullptr}
protected

! object to store results

Definition at line 51 of file TRootSniffer.h.

Libraries for TRootSnifferScanRec:

The documentation for this class was generated from the following files: