ROOT logo
ROOT » MISC » TABLE » TDataSetIter

class TDataSetIter: public TObject


TDataSetIter

TDataSetIter is a class iterator to navigate TDataSet objects
via 4 internal pointers :

1. fRootDataSet    - "root" dataset
2. fWorkingDataSet - Working dataset
3. fDataSet        - the last selected TDataSet
4. fNext           - TIter for the the list of the "root" dataset


Function Members (Methods)

public:
TDataSetIter(const TDataSetIter&)
TDataSetIter(TDataSet* l, Bool_t dir)
TDataSetIter(TDataSet* l = 0, Int_t depth = 1, Bool_t dir = kIterForward)
virtual~TDataSetIter()
voidTObject::AbstractMethod(const char* method) const
virtual TDataSet*Add(TDataSet* set)
virtual TDataSet*Add(TDataSet* set, const Char_t* path)
virtual TDataSet*Add(TDataSet* set, TDataSet* dataset)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
virtual TDataSet*Cd(const Char_t* dirname)
virtual TDataSet*Cd(TDataSet* ds)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual TDataSet*Cwd() const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tDf() const
virtual TDataSet*Dir(Char_t* dirname)
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 Int_tDu() const
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 TDataSet*Find(const Char_t* path, TDataSet* rootset = 0, Bool_t mkdir = kFALSE, Bool_t titleFlag = kFALSE)
virtual TDataSet*FindByName(const Char_t* name, const Char_t* path = "", Option_t* opt = "")
virtual TDataSet*FindByPath(const Char_t* path, TDataSet* rootset = 0, Bool_t mkdir = kFALSE)
virtual TDataSet*FindByPointer(TDataSet* set, const Char_t* path = 0, Option_t* opt = "")
virtual TDataSet*FindByTitle(const Char_t* title, const Char_t* path = "", Option_t* opt = "")
virtual TDataSet*FindDataSet(const Char_t* name, const Char_t* path = "", Option_t* opt = "")
virtual TDataSet*FindDataSet(TDataSet* set, const Char_t* path, Option_t* opt = "")
virtual TObject*FindObject(const Char_t* name) const
virtual TObject*FindObject(const TObject* obj) const
virtual Int_tFlag(UInt_t flag = TDataSet::kMark, TDataSet::EBitOpt reset = TDataSet::kSet)
virtual Int_tFlag(const Char_t* path, UInt_t flag = TDataSet::kMark, TDataSet::EBitOpt reset = TDataSet::kSet)
virtual Int_tFlag(TDataSet* dataset, UInt_t flag = TDataSet::kMark, TDataSet::EBitOpt reset = TDataSet::kSet)
virtual Int_tGetDepth() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*GetOption() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::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
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidls(Option_t* dirname = "") const
virtual TDataSet*Ls(const Char_t* dirname = "", Option_t* opt = "") const
virtual TDataSet*Ls(const Char_t* dirname, Int_t depth) const
virtual TDataSet*ls(TString dirname, Option_t* opt = "") const
virtual TDataSet*ls(const Char_t* dirname, Int_t depth) const
voidTObject::MayNotUse(const char* method) const
virtual TDataSet*Md(const Char_t* dirname)
virtual TDataSet*Mkdir(const Char_t* dirname)
virtual TDataSet*Next(TDataSet::EDataSetPass mode = TDataSet::kContinue)
virtual TDataSet*Next(const Char_t* path, TDataSet* rootset = 0, Bool_t mkdir = kFALSE)
virtual Bool_tNotify()
virtual voidNotify(TDataSet* dataset)
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static 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)
virtual TDataSet*operator()(TDataSet::EDataSetPass mode = TDataSet::kContinue)
virtual TDataSet*operator()(const Char_t* path)
virtual TDataSet*operator*() const
TDataSetIter&operator=(const TDataSetIter&)
virtual TDataSet*operator[](const Char_t* path)
virtual voidTObject::Paint(Option_t* option = "")
virtual TStringPath()
virtual TStringPath(const Char_t* path)
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual TDataSet*Pwd(Option_t* opt = "") const
virtual TDataSet*Rd(const Char_t* dirname, Option_t* option = "")
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidReset(TDataSet* l = 0, Int_t depth = 0)
voidTObject::ResetBit(UInt_t f)
virtual TDataSet*Rmdir(TDataSet* dataset, Option_t* option = "")
virtual TDataSet*Rmdir(const Char_t* dirname, Option_t* option = "")
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(basic_ostream<char,char_traits<char> >& out, Option_t* option = "")
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)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual TDataSet*Shunt(TDataSet* set)
virtual TDataSet*Shunt(TDataSet* set, const Char_t* path)
virtual TDataSet*Shunt(TDataSet* set, TDataSet* dataset)
virtual voidStreamer(TBuffer& b)
voidStreamerNVirtual(TBuffer& 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
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:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
TDataSet*GetNullSet()
voidTObject::MakeZombie()
TDataSet*NextDataSet(TIter& next)
TDataSet*NextDataSet(Int_t nDataSet)

Data Members

protected:
TDataSet*fDataSetPointer to the last selected TDataSet
Int_tfDepththe current depth of the passing
Int_tfMaxDepththe max depth of the passing (=1 by default)
TIter*fNext"standard" ROOT iterator for containers
TIter*fNextSet[100]the list of the TList iterators to bypass the whole dataset
TDataSet*fRootDataSetPointer to the root TDataSet
TDataSet*fWorkingDataSetPointer to the working TDataSet
static TDataSet*fgNullDataSet

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TDataSetIter(TDataSet* l, Bool_t dir)
to be documented
TDataSetIter(TDataSet* l = 0, Int_t depth = 1, Bool_t dir = kIterForward)
to be documented
~TDataSetIter()
to be documented
TDataSet * GetNullSet()
 return a fake pointer == -1 casted to (TDataSet *)
TDataSet * Add(TDataSet *set, TDataSet *dataset)

Add - adds the set to the dataset defined with the second parameters

TDataSet dataset != 0 - Add the set to the TDataSet *dataset

= 0 - (by default) to the current TDataSet defined
with fWorkingDataSet data member

returns  the pointer to set is success or ZERO poiner


Note: If this TDataSetIter is empty (i.e. Cwd() returns 0), the "set"
becomes the "root" dataset of this iterator                        //

TDataSet * Add(TDataSet *dataset, const Char_t *path)

Add

Char_t path != 0 - Add a TDataSet dataset to the TDataSet dataset
defined with "path"
= 0 - (by default) to the current TDataSet defined
with fWorkingDataSet data member

returns the dataset is success or ZERO pointer



TDataSet * Cd(const Char_t *dirname)

TDataSet *TDataSetIter::Cd(const Char_t *dirname)

Change the current working directory to dirname

Returns the pointer to the new "working" TDataSet
=======   0,  if the new directory doesn't exist.

Remark:  The name = ".." has a special meaning.
------   TDataSetIter::Cd("..") returns the parent set
But one still can not use ".." as a legal part
of the full path

TDataSet * Cd(TDataSet *ds)

TDataSet *TDataSetIter::Cd(const TDataSet *ds)

Make:  Cwd() = ds;
 Look for the first occurence of the "ds" pointer for the current
TDataSet in respect of the Cwd() if any

Change the current working directory to ds if present

Returns the pointer to the new "working" TDataSet (i.e. ds)
=======   0,  if the new directory doesn't exist.


TDataSet * Dir(Char_t* dirname)
 Print the names of the TDataSet objects for the datatset named with "dirname"
 apart of TDataSet::Ls()  this method prints one level only

Int_t Du() const
 summarize dataset usage by Herb Ward proposal
TDataSet * FindByName(const Char_t* name, const Char_t* path = "", Option_t* opt = "")
to be documented
TDataSet * FindByTitle(const Char_t* title, const Char_t* path = "", Option_t* opt = "")
to be documented
TDataSet * FindDataSet(const Char_t *name,const Char_t *path,Option_t *opt)
 FindDataSet looks for the object with the name supplied across dataset.

 name        - the "base" name title (with no path) of the TDataSet (see: opt = -t)
 path        - path to start the search from (the current dataset "by default")
 opt = "-i"  - case insensitive search
       "-t"  - first <name> parameter defines the object "title" rather the object "name"

 Note: If the name provided is not unique
       the first found is returned.

TDataSet * FindDataSet(TDataSet *set,const Char_t *path,Option_t *opt)
 Check whether the object does belong the TDataSet defined with "path"
 opt = "-l"  - check the "reference" links only
       "-s"  - check the "structural" links only
             = "by default" - checks all links

TObject * FindObject(const Char_t *name)
 This method is not recommended.
 It is done to back TObject::FindObject method only.
 One is recommnened to use FindByName method instead.
TObject * FindObject(const TObject *dataset)
 This method is not recommended.
 It is done to back TObject::FindObject method only.
 One is recommended to use FindByName method instead.
TDataSet * FindByPointer(TDataSet* set, const Char_t* path = 0, Option_t* opt = "")
 Check whether the object does belong the TDataSet defined with "path"
 opt = "-l"  - check the "reference" links only
       "-s"  - check the "structural" links only
             = "by default" - checks all links

Int_t Flag(const Char_t *path,UInt_t flag,TDataSet::EBitOpt reset)
to be documented
Int_t Flag(TDataSet *dataset,UInt_t flag,TDataSet::EBitOpt reset)
to be documented
TDataSet * Ls(const Char_t *dirname,Option_t *opt)
   Ls(const Char_t *dirname,Option_t)

   Prints the list of the TDataSet defined with dirname

   dirname     = 0   - prints the current dataset
   dirname[0]  = '/' - print TDataSet defined with dirname
   dirname[0] != '/' - prints DataSet with respect of the current class

TDataSet * Ls(const Char_t *dirname,Int_t depth)
   Ls(const Char_t *dirname,Int_t depth)

   Prints the list of the TDataSet defined with dirname
   Returns the dataset defined by "path" or Cwd();

   dirname     = 0   - prints the current dataset
   dirname[0]  = '/' - print TDataSet defined with dirname
   dirname[0] != '/' - prints DataSet with respect of the current class

   depth       = 0   - print all level of the TDataSet defined with dirname
               > 0   - print depth levels at most of the dirname TDataSet

TDataSet * Mkdir(const Char_t* dirname)
to be documented
void Notify(TDataSet* dataset)
  Notify(TDataSet *dataset)

  This dummy method is called when TDataSetIter::Find dives in "dataset"
  to look for thew next level of the dataset's
  printf("void TDataSetIter::Notify(TDataSet *) level: %d %s\n",fDepth,ds->GetName());

TDataSet * Rmdir(TDataSet *dataset,Option_t *)
  Remove the TDataSet *dataset from the current dataset
  If the current dataset is the deleted dataset the its parent
  becomes the "current dataset" or 0 if this dataset has no parent.

  returns: the "current dataset" pointer


TDataSet * Next(TDataSet::EDataSetPass mode = TDataSet::kContinue)

 returns the pointer the "next" TDataSet object
         = 0 if all objects have been returned.

  mode = kContinue  - default normal mode
         kPrune     - stop passing of the current branch but continue with the next one if any
         kUp        - break passing, return to the previous level, then continue
         all other  - are treated as "kContinue"


TDataSet * NextDataSet(TIter &next)
to be documented
TDataSet * NextDataSet(Int_t nDataSet)
 Pick the next object of the  level provided
TDataSet * FindByPath(const Char_t* path, TDataSet* rootset = 0, Bool_t mkdir = kFALSE)
to be documented
TDataSet * Find(const Char_t* path, TDataSet* rootset = 0, Bool_t mkdir = kFALSE, Bool_t titleFlag = kFALSE)

titleFlag = kFALSE; use object name as key (by default)
kTRUE;  use object title as key  and ignore mkdirFlag

"path" ::= <relative path> | <absolute path> | <empty>

"relative path" ::= <dataset name> | <dataset name>/<dataset name>

"absolute path" ::= /<relative path>
"empty"         ::= zero pointer | pointer to zero length string

"relative path": the search is done against of fWorkingDataSet data mem
"absolute path": the search is done against of fRootDataSet    data mem
"empty path"   : no search is done just next TDataSet is returned if any

Remark: This version can not treat any "special name" like "..", ".", etc


void Reset(TDataSet* l = 0, Int_t depth = 0)
 TDataSet *l != 0 means the new start pointer
    depth      != 0 means the new value for the depth
                    otherwise the privious one is used;

TDataSet * Shunt(TDataSet *set, TDataSet *dataset)

Shunt - moves the set to the dataset defined with the second parameters

TDataSet dataset != 0 - Add the set to the TDataSet *dataset

= 0 - (by default) to the current TDataSet defined
with fWorkingDataSet data member

returns  the pointer to set if successful or ZERO pointer


Note: If this TDataSetIter is empty (i.e. Cwd() returns 0), the "set"
becomes the "root" dataset of this iterator                        //

TDataSet * Shunt(TDataSet *dataset, const Char_t *path)

Shunt

Char_t path != 0 - Move a TDataSet dataset from its parent to
the TDataSet dataset
defined with "path"
= 0 - (by default) to the current TDataSet defined
with fWorkingDataSet data member

returns the dataset is success or ZERO pointer



TDataSet * operator[](const Char_t* path)
 operator [] returns the pointer to the TDataSet if it does contain
 any data (TTable for example)

  Input:
     path  = The path to the dataset to find

  Output:
     pointer to the dataset if it found and
     its TDataSet::HasData() method returns non-zero
     (see for example TTable::HasData() )
TDataSetIter(TDataSet* l = 0, Int_t depth = 1, Bool_t dir = kIterForward)
TDataSet * Add(TDataSet* set)
{return Add(set,(TDataSet *)0);}
TDataSet * operator()( TDataSet::EDataSetPass mode=TDataSet::kContinue )
{return Next(mode);}
TDataSet * operator()(const Char_t *path)
{ return Find(path); }
Int_t GetDepth() const
{return fDepth;}
TDataSet * Cwd() const
{return fWorkingDataSet;}
Int_t Df() const
{return 0;}
Int_t Flag(UInt_t flag = TDataSet::kMark, TDataSet::EBitOpt reset = TDataSet::kSet)
{return Flag((TDataSet *)0,flag,reset);}
void ls(Option_t* dirname = "") const
{ Ls(dirname,"");}
TDataSet * ls(TString dirname,Option_t *opt="")
{return Ls(dirname.Data(),opt);}
TDataSet * ls(const Char_t *dirname,Int_t depth)
{return Ls(dirname,depth);}
TDataSet * Md(const Char_t* dirname)
{return Mkdir(dirname);}
TString Path(const Char_t* path)
{TDataSet *set = Find(path); return set ? set->Path():TString ("");}
TString Path()
TDataSet * Pwd(Option_t* opt = "") const
{if (Cwd()) Cwd()->ls(opt); return Cwd();}
TDataSet * Rmdir(TDataSet *dataset,Option_t *option="")
TDataSet * Rd(const Char_t* dirname, Option_t* option = "")
{return Rmdir(Find(dirname),option);}
TDataSet * Shunt(TDataSet* set)
{return Shunt(set,(TDataSet *)0);}
TDataSet * Next(TDataSet::EDataSetPass mode = TDataSet::kContinue)
Bool_t Notify()
{ return TObject::Notify();}
const Option_t * GetOption() const
{ return fNext ? fNext->GetOption():0; }