ROOT logo
ROOT » MISC » TABLE » TDataSet

class TDataSet: public TNamed


TDataSet

TDataSet class is to create a special compound object-container:


TDataSet object ::= the "named" list of TDataSet objects

where the "list" (the pointer to TList object) may contain no object

TDataSet object has a back pointer to its "parent" TDataSet
object, the "character" *name* and "character" *title*

The service this class does provide is to help the user to build
and manage the hierarchy of his/her data but the data itself.

So it is not "Container" itself rather the basement (base class)
to built the containers.

One may derive the custom container classes from TDataSet.
See for example TObjectSet, TTable, TVolume, TFileSet
These classes  derived from TDataSet:

Class Name

TObjectSet::public TDataSet - is a container for TObject
TTable::    public TDataSet - is a container for the array
of any "plain" C-structure
TNode::     public TDataSet - is a container for 3D objects
TMaker::     public TDataSet - is a container for STAR "control"
objects
etc etc

TDataSet class is a base class to implement the directory-like
data structures and maintain it via TDataSetIter class iterator

TDataSet can be iterated using an iterator object (see TDataSetIter)
or by TDataSet::Pass method (see below)

Terms:    Dataset       - any object from the list above
=====     Member          is called "DataSet Member"

Structural      - the "Dataset Member" is its
member          "Structural member" if its "back pointer"
points to this object

Dataset        - we will say this TDataSet object "OWNs"
Owner           (or is an OWNER / PARENT of ) another
(parent)          TDataSet object if the last one is its
"Structural Member"

Associated      - If some object is not "Structural member"
member          of this object we will say it is an
"Associated Member" of this dataset

Orphan         - If some dataset is a member of NO other
dataset          TDataSet object it is called an "orphan"
dataset object

- Any TDataSet object may be "Owned" by one and only one another
TDataSet object if any.

- Any TDataSet object can be the "Structural Member" of one and
only one another TDataSet

- Any TDataSet object may be an "Associated Member" for any number
of other TDataSet objects if any

- NAME issue:
Each "dataset member" is in possession of some "alpha-numerical"
NAME as defined by TNamed class.
The NAME may contain any "printable" symbols but "SLASH" - "/"
The symbol "RIGHT SLASH" - "/" can not be used as any part of the
"DataSet Member" NAME
Any DataSet  can be found by its NAME with TDataSetIter object

- TITLE issue:
Each "dataset member" is in possession of the "alpha-numerical"
TITLE as defined by TNamed class. The meaning of the TITLE is
reserved for the derived classes to hold there some indetification
that is special for that derived class.

   This means the user must be careful about  the "TDataSet           //
NAME and TITLE since this may cause some "side effects" of the
particular class functions

- It is NOT required those all "DataSet Members" are in possession
of the unique names, i.e. any number of "DataSet Members"
may bear one and the same name

Actions:

Create  DataSet is born either as "Orphan" or
as "Structural Member"
of another TDataSet object

Add     One dataset can be included into another dataset.
Upon adding:
-  the "Orphan dataset" becomes "Structural Member"
- "Structural Members" of another dataset becomes the
"Associated Member" of this datatset

Delete  - Upon deleting the "Structural Member":
- "REMOVES" itself  from the "Parent DataSet".
- Its "Associated memberships" is not changed though

              The last means the DataSet with the "Associated Members"
may contain a DIED pointers to unexisting "Associated"
objects !!!

Further information is provided my the particular method
descriptions.

The TDataSet class has several methods to control object('s)
memberships


Function Members (Methods)

public:
TDataSet(TNode& src)
TDataSet(const TDataSet& src, TDataSet::EDataSetPass iopt = kAll)
TDataSet(const char* name = "", TDataSet* parent = 0, Bool_t arrayFlag = kFALSE)
virtual~TDataSet()
voidTObject::AbstractMethod(const char* method) const
virtual voidAdd(TDataSet* dataset)
virtual voidAddAt(TDataSet* dataset, Int_t idx = 0)
virtual voidAddAtAndExpand(TDataSet* dataset, Int_t idx = 0)
virtual voidAddFirst(TDataSet* dataset)
virtual voidAddLast(TDataSet* dataset)
virtual voidTObject::AppendPad(Option_t* option = "")
TDataSet*At(Int_t idx) const
virtual voidBrowse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*Clone(const char* newname = "") const
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidDelete(Option_t* opt = "")
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 TDataSet*Find(const char* path) const
virtual TDataSet*FindByName(const char* name, const char* path = "", Option_t* opt = "") const
virtual TDataSet*FindByPath(const char* path) const
virtual TDataSet*FindByTitle(const char* title, const char* path = "", Option_t* opt = "") const
virtual TObject*FindObject(const char* name) const
virtual TObject*FindObject(const TObject* o) const
virtual TDataSet*First() const
virtual TSeqCollection*GetCollection() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TList*GetList() const
virtual Int_tGetListSize() const
static TDataSet*GetMainSet()
TObject*GetMother() const
virtual const char*TNamed::GetName() const
TObjArray*GetObjArray() const
virtual TObject*GetObject() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual TDataSet*GetParent() const
virtual const char*TNamed::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual Long_tHasData() const
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
virtual TDataSet*Instance() const
static TDataSet*instance()
voidInvertAllMarks()MENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tIsEmpty() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tIsFolder() const
virtual Bool_tIsMarked() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
virtual Bool_tIsThisDir(const char* dirname, int len = -1, int ignorecase = 0) const
Bool_tTObject::IsZombie() const
virtual TDataSet*Last() const
virtual voidls(Option_t* option = "") const
virtual voidls(Int_t depth) const
voidMark()MENU
voidMark(UInt_t flag, TDataSet::EBitOpt reset = kSet)
voidMarkAll()MENU
voidTObject::MayNotUse(const char* method) const
virtual TDataSet*Next() const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
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 voidTObject::Paint(Option_t* option = "")
virtual TDataSet::EDataSetPassPass(void callback, Int_t depth = 0)
virtual TDataSet::EDataSetPassPass(void callback, void* user, Int_t depth = 0)
virtual TStringPath() const
virtual voidTObject::Pop()
virtual TDataSet*Prev() const
virtual voidTNamed::Print(Option_t* option = "") const
virtual voidPrintContents(Option_t* opt = "") const
virtual Int_tPurge(Option_t* opt = "")
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidRemove(TDataSet* set)
virtual TDataSet*RemoveAt(Int_t idx)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& 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)
virtual voidSetMother(TDataSet* parent = 0)
virtual voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
virtual voidSetObject(TObject* obj)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidSetParent(TDataSet* parent = 0)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidSetWrite()
virtual voidShowMembers(TMemberInspector&)
virtual voidShunt(TDataSet* newParent = 0)
virtual Int_tTNamed::Sizeof() const
virtual voidSort()
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
voidUnMark()MENU
voidUnMarkAll()MENU
virtual voidUpdate()
virtual voidUpdate(TDataSet* set, UInt_t opt = 0)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tWrite(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tWrite(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
TDataSet(const char* name, const char* title)
voidAddMain(TDataSet* set)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
TDataSet*GetRealParent()
voidMakeCollection()
voidTObject::MakeZombie()
virtual voidSetMother(TObject* mother)
static TDataSet::EDataSetPassSortIt(TDataSet* ds)
static TDataSet::EDataSetPassSortIt(TDataSet* ds, void* user)
private:
voidoperator=(const TDataSet&)

Data Members

public:
enum EDataSetPass { kContinue
kPrune
kStop
kUp
kStruct
kAll
kRefs
kMarked
};
enum ESetBits { kMark
kArray
};
enum EBitOpt { kSet
kReset
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TSeqCollection*fListList of the the the objects included into this dataset
TStringTNamed::fNameobject identifier
TDataSet*fParentpointer to mother of the directory
TStringTNamed::fTitleobject title
static TDataSet*fgMainSetpointer the main dataset;

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TDataSet(const char* name = "", TDataSet* parent = 0, Bool_t arrayFlag = kFALSE)
  cout << "ctor for " << GetName() << " - " << GetTitle() << endl;
TDataSet * GetRealParent()
return real parent
TDataSet(const TDataSet& src, TDataSet::EDataSetPass iopt = kAll)
 Creates TDataSet (clone) with a topology similar with TDataSet *pattern

  Parameters:

  pattern        - the pattern dataset
  iopt = kStruct - clone only my structural links
         kAll    - clone all links
         kRefs   - clone only refs
         kMarked - clone marked (not implemented yet) only

   All new-created sets become the structural ones anyway.

  cout << "ctor for " << GetName() << " - " << GetTitle() << endl;
TDataSet(TNode& src)
 This copy ctor has been depricated (left for thwe sake of the backweard compatibility)
~TDataSet()
              cout << "Default destructor for " << GetName() << " - " << GetTitle() << endl;
void MakeCollection()
 Create the internal container at once if any
void AddAt(TDataSet* dataset, Int_t idx = 0)
 Add TDataSet object at the "idx" position in ds
 or at the end of the dataset
 The final result is defined by either TList::AddAt or TObjArray::AddAt
 methods

void AddAtAndExpand(TDataSet* dataset, Int_t idx = 0)
   !!!! Under construction !!!!!
 Add TDataSet object at the "idx" position in ds
 or at the end of the dataset
 The final result is defined by either TList::AddAt or TObjArray::AddAt
 methods

void AddLast(TDataSet* dataset)
 Add TDataSet object at the end of the dataset list of this dataset
void AddFirst(TDataSet* dataset)
 Add TDataSet object at the beginning of the dataset list of this dataset
void Browse(TBrowser* b)
 Browse this dataset (called by TBrowser).
TObject * Clone(const char* newname = "") const
 the custom implementation fo the TObject::Clone
void Delete(Option_t* opt = "")
 Delete - deletes the list of the TDataSet objects and all "Structural Members"
          as well
          This method doesn't affect the "Associated Members"

TDataSet * FindByPath(const char* path) const
 Aliase for TDataSet::Find(const Char_t *path) method
TDataSet * Find(const char* path) const
 Full description see: TDataSetIter::Find

 Note. This method is quite expansive.
 ----- It is done to simplify the user's code when one wants to find ONLY object.
       If you need to find more then 1 object in this dataset,
       regard using TDataSetIter class yourself.

TDataSet * FindByName(const char* name, const char* path = "", Option_t* opt = "") const
 Full description see: TDataSetIter::Find

 Note. This is method is quite expansive.
 ----- It is done to simplify the user's code when one wants to find ONLY object.
       If you need to find more then 1 object in this dataset,
       regard using TDataSetIter class yourself.

TDataSet * FindByTitle(const char* title, const char* path = "", Option_t* opt = "") const
 Full description see: TDataSetIter::Find

 Note. This method is quite expansive.
 ----- It is done to simplify the user's code when one wants to find ONLY object.
       If you need to find more then 1 object in this dataset,
       regard using TDataSetIter class yourself.

TDataSet * First() const
  Return the first object in the list. Returns 0 when list is empty.
void AddMain(TDataSet* set)
add data set to main data set
TDataSet * GetMainSet()
return pointer to the main dataset
TObject * GetObject() const
 The depricated method (left here for the sake of the backward compatibility)
TDataSet * Last() const
 Return the last object in the list. Returns 0 when list is empty.
TDataSet * Next() const
 Return the object next to this one in the parent structure
 This convinient but time-consuming. Don't use it in the inner loops
TDataSet * Prev() const
 Return the object that is previous to this one in the parent structure
 This convinient but time-consuming. Don't use it in the inner loops
void SetObject(TObject* obj)
 The depricated method (left here for the sake of the backward compatibility)
void ls(Option_t* option = "") const

ls(Option_t *option)

option       - defines the path to be listed
= "*" -  means print all levels


void ls(Int_t depth) const

ls(Int_t depth)

Prints the list of the this TDataSet.

Parameter:

Int_t depth >0 the number of levels to be printed
=0 all levels will be printed
No par - ls() prints only level out


TDataSet * Instance() const
 apply the class default ctor to instantiate a new object of the same kind.
 This is a base method to be overriden by the classes
 derived from TDataSet (to support TDataSetIter::Mkdir for example)
Bool_t IsThisDir(const char* dirname, int len = -1, int ignorecase = 0) const
 Compare the name of the TDataSet with "dirname"
 ignorercase flags indicates whether the comparision is case sensitive
void MarkAll()
 Mark all members of this dataset
void UnMarkAll()
 UnMark all members of this dataset
void InvertAllMarks()
 Invert mark bit for all members of this dataset
Bool_t IsEmpty() const
 return kTRUE if the "internal" collection has no member
void PrintContents(Option_t* opt = "") const
 Callback method to complete ls() method recursive loop
 This is to allow to sepoarate navigation and the custom invormation
 in the derived classes (see; TTable::PrintContents for example
TString Path() const
 return the full path of this data set
void Remove(TDataSet* set)
 Remiove the "set" from this TDataSet
TDataSet * RemoveAt(Int_t idx)
 Remove object from the "idx" cell of this set and return
 the pointer to the removed object if any

Int_t Purge(Option_t* opt = "")
 Purge  - deletes all "dummy" "Structural Members" those are not ended
          up with some dataset with data inside (those return HasData() = 0)

 Purge does affect only the "Structural Members" and doesn't "Associated" ones

void SetParent(TDataSet* parent = 0)
  Break the "parent" relationship with the current object parent if present
  parent != 0   Makes this object the "Structural Member"
                of the "parent" dataset
          = 0   Makes this object the "pure Associator", i.e it makes this
                object the "Structural Member" of NO other TDataSet

void SetWrite()
 One should not use this method but TDataSet::Write instead
 This method os left here for the sake of the backward compatibility
 To Write object first we should temporary break the
 the backward fParent pointer (otherwise ROOT follows this links
 and will pull fParent out too.

void Shunt(TDataSet* newParent = 0)
  Remove the object from the original and add it to dataset
  TDataSet dataset   != 0  -  Make this object the "Structural Member"
                                of "dataset"
                        = 0  -  Make this object "Orphan"

void Update(TDataSet* set, UInt_t opt = 0)
 Update this TDataSet with "set"

 ATTENTION !!!

 This method changes the parent relationships of the input "set"

void Update()
  Update()

  Recursively updates all tables for all nested datasets
  in inverse order

void Sort()
 Sort recursively all members of the TDataSet with TList::Sort method
Int_t Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
 To Write object first we should temporary break the
 the backward fParent pointer (otherwise ROOT follows this links
 and will pull fParent out too.

Int_t Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
 To Write object first we should temporary break the
 the backward fParent pointer (otherwise ROOT follows this links
 and will pull fParent out too.

void Add(TDataSet* dataset)
{ AddLast(dataset); }
TDataSet * At(Int_t idx) const
{return fList ? (TDataSet *)fList->At(idx) : 0; }
Int_t GetListSize() const
{return (fList) ? fList->GetSize():0;}
TDataSet * instance()
{ return new TDataSet();}
Bool_t IsMarked() const
{ return TestBit(kMark); }
void Mark(UInt_t flag, TDataSet::EBitOpt reset = kSet)
{ SetBit(flag,reset); }
void Mark()
void UnMark()
void operator=(const TDataSet& )
 --   Int_t IncCnt(){ fCnt++; return fCnt;}
 --   Int_t DecCnt(){ fCnt--; return fCnt;}
 --   Int_t Cnt()   { return fCnt;}
{}
void SetMother(TObject* mother)
 --     Int_t               fCnt;      // reference counter.
{SetParent((TDataSet*)mother);}
TDataSet(const char* name, const char* title)
{}
EDataSetPass SortIt(TDataSet* ds)
EDataSetPass SortIt(TDataSet* ds, void* user)
TObject * FindObject(const char* name) const
{return FindByName(name);}
TObject * FindObject(const TObject* o) const
{ return TObject::FindObject(o);}
TObjArray * GetObjArray() const
{ return (TObjArray *)fList; }
TSeqCollection * GetCollection() const
{ return (TSeqCollection *)fList; }
TList * GetList() const
{ return (TList *)fList; }
TObject * GetMother() const
{ return (TObject*)GetParent();}
TDataSet * GetParent() const
{ return fParent;}
Long_t HasData() const
{return 0;}
void SetMother(TDataSet* parent = 0)
{SetParent(parent);}
Bool_t IsFolder() const
{return kTRUE;}