class TFTable: public TFIOElement


  File:      TFTable.cpp

  Version:   1.0

  Author:    Reiner Rohlfs (GADC)

  History:   1.0   17.07.03  first released version


Function Members (Methods)

public:
TFTable()
TFTable(const TFTable& table)
TFTable(TTree* tree)
TFTable(const char* name, UInt_t numRows = 0)
TFTable(const char* name, const char* fileName)
virtual~TFTable()
voidTObject::AbstractMethod(const char* method) const
virtual voidTFHeader::AddAttribute(const TFBaseAttr& attr, Bool_t replace = kTRUE)
virtual Int_tAddColumn(TFBaseCol* column, Bool_t replace = kFALSE)
virtual TFBaseCol&AddColumn(const char* name, TClass* colDataType, Bool_t replace = kFALSE)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
virtual voidTFIOElement::CloseElement()
virtual Int_tTNamed::Compare(const TObject* obj) const
virtual voidTNamed::Copy(TObject& named) const
virtual voidTFHeader::DelAttribute(const char* key, Int_t index = -1)
virtual voidTObject::Delete(Option_t* option = "")
virtual voidDeleteColumn(const char* name)
virtual Int_tDeleteElement(Bool_t updateMemory = kFALSE)
virtual voidDeleteRows(UInt_t numRows = 1, UInt_t pos = TF_MAX_ROWS)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() const
virtual TObject*TObject::DrawClone(Option_t* option = "") const
virtual voidTObject::Dump() const
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 TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual TFBaseAttr&TFHeader::GetAttribute(const char* key, UInt_t index = 0) const
virtual TFBaseCol&GetColumn(const char* name) const
virtual Int_tTFIOElement::GetCompressionLevel()
virtual Int_tTFIOElement::GetCycle() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TFIOElement::GetFileName() const
virtual const char*TObject::GetIconName() const
virtual const char*TNamed::GetName() const
virtual UInt_tTFHeader::GetNumAttributes(const char* key = NULL) const
virtual UInt_tGetNumColumns() const
virtual UInt_tGetNumRows() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
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 voidInsertRows(UInt_t numRows = 1, UInt_t pos = TF_MAX_ROWS)
virtual voidTObject::Inspect() const
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTFIOElement::IsFileConnected() const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTNamed::ls(Option_t* option = "") const
virtual TFAttrIterTFHeader::MakeAttrIterator() const
virtual TFColIterMakeColIterator() const
virtual TGraphErrors*MakeGraph(const char* xCol, const char* yCol, const char* xErrCol = NULL, const char* yErrCol = NULL, TGraphErrors* graph = NULL)
virtual TFRowIterMakeRowIterator() const
virtual TTree*MakeTree(TFNameConvert* nameConvert = NULL) const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
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 TFTable&operator=(const TFTable& table)
virtual booloperator==(const TFHeader& ioelement) const
virtual TFBaseCol&operator[](const char* name) const
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual voidTFHeader::PrintH(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidReserve(UInt_t rows)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") const
virtual Int_tSaveElement(const char* fileName = NULL, Int_t compLevel = -1)
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 voidTFIOElement::SetCompressionLevel(Int_t level)
virtual voidTObject::SetDrawOption(Option_t* option = "")
static voidTObject::SetDtorOnly(void* obj)
voidTFIOElement::SetFileAccess(FMode mode)
voidTFIOElement::SetIO(TFVirtualIO* io)
virtual voidTNamed::SetName(const char* name)
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp, char* parent)
virtual Int_tTNamed::Sizeof() const
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
voidTObject::MakeZombie()
virtual voidTFIOElement::NewFile(const char* fileName)
virtual voidUpdateMemory()
private:
voidReadAllCol() const
set<TFColWrapper,less<TFColWrapper>,allocator<TFColWrapper> >::iteratorReadCol(const char* name) const

Data Members

public:
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
UInt_tfAlreadyRead! number of columns already read from file
list<TFBaseAttr*>TFHeader::fAttra list of attributes
ColListfColumns! sorted list of all columns of this table
FModeTFIOElement::fFileAccess!access to the file read, readwrite
TStringTNamed::fNameobject identifier
UInt_tfNumRowsnumber of rows of this table
Bool_tfReadAll! kTRUE if all columns read from file
TStringTNamed::fTitleobject title
TFVirtualIO*TFIOElement::fio!interface to the file

Class Charts

Inheritance Chart:
TObject
TNamed
TFHeader
TFIOElement
TFTable
TFGroup

Function documentation

TFTable()
 Default constructor. The table has no columns, no rows and is not
 associated with a table in a file.
 Don't use this constructor. The table should have at least a name.
TFTable(TTree * tree)
 the table is created from all branches of the tree which store simple
 variables. The othere branches are skipped.
 Warning:
 This function sets the "branch status process" (tree->SetBranchStatus())
 of all branches which can be copied into a TFTable to 1 and set the
 status of all other branches to 0.
TFTable(const char * name, UInt_t numRows)
 The table has no columns, numRows rows and is not associated with a table
 in a file. name is the id of the new table. Default value of numRows is 0.
TFTable(const char * name, const char * fileName)
 A new table is created. It has no columns, no rows but is associated
 with a table in a file. name is the id of the new table.
 fileName is the file name of the file with this new table.
 The file extension define the used file type:
 *.fits, *.fts, *fit and *.fits.gz define a FITS file.
 *.root define a ROOT file and
 *.asro and anything else define a ASRO file.
 The file may already exist or will be created. Other objects with the
 same name can exist without problem in the same file. Each object with
 the same name has a unique cycle number. Use GetCycle() to ask for this
 cycle number. Use the global function TFReadTable() to read and
 update an already existing table from an ASRO file, a ROOT file or a
 FITS file.
TFTable(const TFTable & table)
 Copy constructor. But even if the input table is associated with a table
 in a file, this new table is NOT associated with this or an other
 table in a file. The new table exist only in memory.
~TFTable()
 Also the columns of this table are deleted from memory.
TFTable & operator=(const TFTable& table)
 Even if the input table is associated with a table in a file,
 this table is NOT associated with this or an other table in a
 file. If this table was associates with a table in a file before
 this function the file is closed without update. After this function
 call this table exist only in memory, but can be saved in a file
 with the SaveElement() function.
Int_t AddColumn(TFBaseCol* column, Bool_t replace = kFALSE)
 Adds one column to the table. The column names in one table have to
 be unique. If a column with the same name already exist and replace ==
 kTRUE the old column is deleted and replaced by the new one. If
 replace == kFALSE (the default value) the new column is not added to
 the table and an error is written to the TFError class.
 The column is adopted to the table and will be deleted by the table
 when the table is deleted from memory.
 The number of rows of the column will be increased or decreased to the
 number of rows of the table, respectively.
TFBaseCol & AddColumn(const char* name, TClass* colDataType, Bool_t replace = kFALSE)
 Creates a new column of type colDataType and adds it to the table.
 The column names in one table have to be unique. If a column with
 the same name already exist and replace == kTRUE the old column is
 deleted and replaced by the new one. If replace == kFALSE (the default
 value) the new column is not added to the table and either TFException
 is thrown or a reference to the already existing column named "name"
 is returned, depending on a call of TFError::SetErrorType().
 The column is adopted to the table and will be deleted by the table
 when the table is deleted from memory.
 The number of rows of the new column will be set to the number of rows
 of the table.
 Use the static member function Class() of the required column data type
 to pass a TClass variable at the second parameter.
void DeleteColumn(const char* name)
 Deletes the column with the id name from this table and
 from memory.
 If the table is associated with a file the column is also immediately
 deleted in the file without calling the SaveElement() function.
 If a column with the id "name" does not exist in this table the function
 does nothing, no warning and no error message.
TFBaseCol & GetColumn(const char* name) const
 Gets a reference of the column with name "name". The column is still
 adopted to the table and will be deleted from memory when the
 table is deleted.
 If no column with name "name" exist in the table a TFException is thrown
 or a reference to a NULL pointer is returned, depending on a call of
 TFError::SetErrorType().
TFColIter MakeColIterator()
 Returns an iterator for all columns. This iterator can be used
 to retrieve all columns if their names are unknown.
TFRowIter MakeRowIterator()
 Returns an iterator for all rows of this table. This iterator can
 be used to sort the rows depending on a column and to filter rows.
 The filter can be expressed with a c - statement and can depend on
 values in any column and on row number. See TFRowIter for more
 information on sorting and filter.
void InsertRows(UInt_t numRows = 1, UInt_t pos = TF_MAX_ROWS)
 Insert rows into the table. All columns of the table are updated.
 pos is the first index of the new rows. If pos is greater than the
 actual number of rows in the table all new rows are inserted at the
 end of the table. The index of the row number is 0 based.
 The table in the file is not updated. Use the SaveElement() to
 update the table in the ASRO, ROOT or FITS file.
void DeleteRows(UInt_t numRows = 1, UInt_t pos = TF_MAX_ROWS)
 Delete numRows from all columns. The first removed column has the
 index pos. The index of the row numbers is 0 based.
 If pos + numRows is greater than the actual number of rows all
 rows beginning with row number pos are deleted. If pos is greater
 or equal than the actual number of rows than no rows are deleted.
 But if pos == TF_MAX_ROWS the last numRows of the table are removed.
UInt_t GetNumColumns()
 Returns the actual number of columns in the table (in memory and in
 file)
void Reserve(UInt_t rows)
 To avoid memory movements each time a new row is inserted
 into the table some additional rows are allocated more than
 necessary. These additional rows are used the next time new
 rows are inserted. "rows" defines the maximum number of rows that
 can be used before new memory will be allocated.
I_ColList ReadCol(const char* name) const
 reads one column from the ASRO, ROOT or FITS file into memory.
 private function. Use GetColumn to retrieve a column from this table
void ReadAllCol()
 Reads all not yet read columns from the ASRO, ROOT or FITS file into memory
 Private function, called automatically if needed.
Int_t SaveElement(const char* fileName = NULL, Int_t compLevel = -1)
 Updates the table in the ASRO, ROOT or FITS file with the data of this
 table in memory. If fileName is defined the old file is closed and the
 table is written into this new file named fileName.
 compLevel defines the compression level in the ASRO and ROOT file. It is
 not used for FITS files. To set compLevel and to update the table in the
 same file set fileName to an empty string "".
 This function without any parameter has to be used to update the
 ASRO, the ROOT or the FITS file with any change of the table.
 This function does nothing if the table was opened with kFRead
Int_t DeleteElement(Bool_t updateMemory = kFALSE)
 Deletes the table in the file, but not in memory.
 Closes the file and deletes the file if this table is the
 last element in the file.
 Note: Some columns of the table may not yet be read from the table
       and are not in memory. Set updateMemory to kTRUE to have access
       to all columns of this table after it is deleted in the file.
       The default value of updateMemeory is kFALSE.
TTree * MakeTree(TFNameConvert* nameConvert = NULL) const
 creates a TTree from all basic column of this table. Each
 column is copied in one branch of the tree. The tree gets
 the name of this table, each branch gets the name of its
 column.
 nameConvert can be NULL. But it will be adopted by this
 function and will be deleted by this function if it is not NULL.
 The calling function has to delete the returning tree.
TGraphErrors * MakeGraph(const char* xCol, const char* yCol, const char* xErrCol = NULL, const char* yErrCol = NULL, TGraphErrors* graph = NULL)
 A TGraphErrors is created from all data of two columns and two further
 columns can be used for the errors. The column names, used to fill the
 graph has to be passed as the first 4 parameters.
 It is possible to use columns of different tables: The first time call
 MakeGraph with graph == NULL and some column names may be set to NULL
 as well. Call MakeGraph of the further tables and pass the returned graph of
 the first call as the 5th parameter. At any call column names
 can be set to NULL or "". These are not used to fill the graph.
 The number of points of the graph is the number of rows of the first
 table.
 It is not necessary to derfine columns for the X - and Y - errors.
 Null values in a column are set to 0 in the graph, for the X - and Y
 values as well as for the errors.

 If the first table has less than 2 rows or if a column does not exist
 in the table an error message is written to TFError.
void Print(Option_t* option = "") const
TFBaseCol & operator[](const char* name) const
{return GetColumn(name);}
UInt_t GetNumRows()
{return fNumRows;}
void UpdateMemory()
{ReadAllCol();}

Author: (GADC)
Last update: Fri Mar 14 13:55:24 2008

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.