StRoot
1
|
Public Types | |
typedef tableDescriptor_st * | iterator |
Public Types inherited from TTable | |
enum | EColumnType { kNAN, kFloat, kInt, kLong, kShort, kDouble, kUInt, kULong, kUShort, kUChar, kChar, kPtr, kBool, kEndColumnType } |
enum | ETableBits { kIsNotOwn = BIT(23) } |
Public Types inherited from TDataSet | |
enum | EDataSetPass { kContinue, kPrune, kStop, kUp, kStruct, kAll, kRefs, kMarked } |
enum | ESetBits { kMark = BIT(22), kArray = BIT(20) } |
enum | EBitOpt { kSet = kTRUE, kReset = kFALSE } |
Public Member Functions | |
TTableDescriptor (const TTable *parentTable) | |
to be documented | |
TTableDescriptor (TClass *classPtr) | |
TTableDescriptor (const TTableDescriptor &dsc) | |
virtual | ~TTableDescriptor () |
class destructor | |
virtual Int_t | AddAt (const void *c) |
Append one row pointed by "c" to the descriptor. | |
virtual void | AddAt (const void *c, Int_t i) |
Add one row pointed by "c" to the "i"-th row of the descriptor. | |
virtual void | AddAt (const tableDescriptor_st &element, const char *comment, Int_t indx) |
virtual void | AddAt (TDataSet *dataset, Int_t idx=0) |
TString | CreateLeafList () const |
Create a list of leaf to be useful for TBranch::TBranch ctor. | |
void | LearnTable (const TTable *parentTable) |
to be documented | |
void | LearnTable (TClass *classPtr) |
const Char_t * | ColumnName (Int_t columnIndex) const |
Int_t | ColumnByName (const Char_t *columnName=0) const |
Find the column index but the column name. | |
UInt_t | NumberOfColumns () const |
const UInt_t * | IndexArray (Int_t columnIndex) const |
UInt_t | Offset (Int_t columnIndex) const |
Int_t | Offset (const Char_t *columnName=0) const |
UInt_t | ColumnSize (Int_t columnIndex) const |
Int_t | ColumnSize (const Char_t *columnName=0) const |
to be documented | |
UInt_t | TypeSize (Int_t columnIndex) const |
Int_t | TypeSize (const Char_t *columnName=0) const |
to be documented | |
UInt_t | Dimensions (Int_t columnIndex) const |
Int_t | Dimensions (const Char_t *columnName=0) const |
to be documented | |
TTable::EColumnType | ColumnType (Int_t columnIndex) const |
TTable::EColumnType | ColumnType (const Char_t *columnName=0) const |
to be documented | |
TClass * | RowClass () const |
void | SetOffset (UInt_t offset, Int_t column) |
void | SetSize (UInt_t size, Int_t column) |
void | SetTypeSize (UInt_t size, Int_t column) |
void | SetDimensions (UInt_t dim, Int_t column) |
Int_t | Sizeof () const |
to be documented | |
void | SetColumnType (TTable::EColumnType type, Int_t column) |
virtual Int_t | UpdateOffsets (const TTableDescriptor *newDesciptor) |
TDataSet * | MakeCommentField (Bool_t createFlag=kTRUE) |
Instantiate a comment dataset if any. | |
TTableDescriptor (const char *name) | |
TTableDescriptor (Int_t n) | |
TTableDescriptor (const char *name, Int_t n) | |
tableDescriptor_st * | GetTable (Int_t i=0) const |
tableDescriptor_st & | operator[] (Int_t i) |
const tableDescriptor_st & | operator[] (Int_t i) const |
tableDescriptor_st * | begin () const |
tableDescriptor_st * | end () const |
Public Member Functions inherited from TTable | |
TTable (const char *name=0, Int_t size=0) | |
Default TTable ctor. | |
TTable (const char *name, Int_t n, Int_t size) | |
Create TTable object and set array size to n longs. | |
TTable (const char *name, Int_t n, Char_t *array, Int_t size) | |
Create TTable object and initialize it with values of array. | |
TTable (const char *name, const char *type, Int_t n, Char_t *array, Int_t size) | |
Create TTable object and initialize it with values of array. | |
TTable (const TTable &table) | |
Copy constructor. | |
TTable & | operator= (const TTable &rhs) |
virtual | ~TTable () |
Delete TTable object. | |
virtual void | Adopt (Int_t n, void *array) |
virtual Long_t | AppendRows (const void *row, UInt_t nRows) |
virtual void | AsString (void *buf, EColumnType type, Int_t width, std::ostream &out) const |
const void * | At (Int_t i) const |
Returns a pointer to the i-th row of the table. | |
virtual void | Browse (TBrowser *b) |
Wrap each table coulumn with TColumnView object to browse. | |
virtual void | CopySet (TTable &array) |
to be documented | |
Int_t | CopyRows (const TTable *srcTable, Long_t srcRow=0, Long_t dstRow=0, Long_t nRows=0, Bool_t expand=kFALSE) |
virtual void | DeleteRows (Long_t indx, UInt_t nRows=1) |
virtual void | Draw (Option_t *opt) |
virtual TH1 * | Draw (TCut varexp, TCut selection, Option_t *option="", Int_t nentries=1000000000, Int_t firstentry=0) |
virtual TH1 * | Draw (const char *varexp, const char *selection, Option_t *option="", Int_t nentries=1000000000, Int_t firstentry=0) |
void * | GetArray () const |
virtual TClass * | GetRowClass () const |
to be documented | |
Int_t | GetSize () const |
virtual Long_t | GetNRows () const |
Returns the number of the used rows for the wrapped table. | |
virtual Long_t | GetRowSize () const |
Returns the size (in bytes) of one table row. | |
virtual Long_t | GetTableSize () const |
Returns the number of the allocated rows. | |
virtual TTableDescriptor * | GetTableDescriptors () const |
protected: create a new TTableDescriptor descriptor for this table | |
virtual TTableDescriptor * | GetRowDescriptors () const |
to be documented | |
virtual const Char_t * | GetType () const |
Returns the type of the wrapped C-structure kept as the TNamed title. | |
virtual void | Fit (const char *formula, const char *varexp, const char *selection="", Option_t *option="", Option_t *goption="", Int_t nentries=1000000000, Int_t firstentry=0) |
virtual Long_t | HasData () const |
virtual Long_t | InsertRows (const void *rows, Long_t indx, UInt_t nRows=1) |
virtual Bool_t | IsFolder () const |
Int_t | NaN () |
virtual Char_t * | MakeExpression (const Char_t *expressions[], Int_t nExpressions) |
virtual Char_t * | Print (Char_t *buf, Int_t n) const |
Create IDL table defintion (to be used for XDF I/O) | |
virtual void | Print (Option_t *opt="") const |
virtual const Char_t * | Print (Int_t row, Int_t rownumber=10, const Char_t *colfirst="", const Char_t *collast="") const |
virtual void | PrintContents (Option_t *opt="") const |
to be documented | |
virtual const Char_t * | PrintHeader () const |
Print general table inforamtion. | |
virtual void | Project (const char *hname, const char *varexp, const char *selection="", Option_t *option="", Int_t nentries=1000000000, Int_t firstentry=0) |
virtual Int_t | Purge (Option_t *opt="") |
Shrink the table to free the unused but still allocated rows. | |
void * | ReAllocate (Int_t newsize) |
void * | ReAllocate () |
virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
Save a primitive as a C++ statement(s) on output stream "out". | |
virtual void | Set (Int_t n) |
Set array size of TTable object to n longs. If n<0 leave array unchanged. | |
virtual void | Set (Int_t n, Char_t *array) |
virtual void | SetNRows (Int_t n) |
virtual void | Reset (Int_t c=0) |
Fill the entire table with byte "c" ; / c=0 "be default" | |
virtual void | ResetMap (Bool_t wipe=kTRUE) |
virtual void | Update () |
to be documented | |
virtual void | Update (TDataSet *set, UInt_t opt=0) |
void * | operator[] (Int_t i) |
const void * | operator[] (Int_t i) const |
virtual Int_t | GetColumnIndex (const Char_t *columnName) const |
virtual const Char_t * | GetColumnName (Int_t columnIndex) const |
virtual const UInt_t * | GetIndexArray (Int_t columnIndex) const |
virtual UInt_t | GetNumberOfColumns () const |
virtual UInt_t | GetOffset (Int_t columnIndex) const |
virtual Int_t | GetOffset (const Char_t *columnName=0) const |
virtual UInt_t | GetColumnSize (Int_t columnIndex) const |
virtual Int_t | GetColumnSize (const Char_t *columnName=0) const |
virtual UInt_t | GetTypeSize (Int_t columnIndex) const |
virtual Int_t | GetTypeSize (const Char_t *columnName=0) const |
virtual UInt_t | GetDimensions (Int_t columnIndex) const |
virtual Int_t | GetDimensions (const Char_t *columnName=0) const |
virtual EColumnType | GetColumnType (Int_t columnIndex) const |
virtual EColumnType | GetColumnType (const Char_t *columnName=0) const |
virtual const Char_t * | GetColumnComment (Int_t columnIndex) const |
Get a comment from the table descriptor. | |
piterator | pbegin () |
piterator | pend () |
Public Member Functions inherited from TDataSet | |
TDataSet (const char *name="", TDataSet *parent=0, Bool_t arrayFlag=kFALSE) | |
TDataSet (const TDataSet &src, EDataSetPass iopt=kAll) | |
TDataSet (TNode &src) | |
This copy ctor has been depricated (left for thwe sake of the backweard compatibility) | |
virtual | ~TDataSet () |
std::cout << "Default destructor for " << GetName() << " - " << GetTitle() << std::endl; | |
virtual void | Add (TDataSet *dataset) |
virtual void | AddAtAndExpand (TDataSet *dataset, Int_t idx=0) |
virtual void | AddFirst (TDataSet *dataset) |
Add TDataSet object at the beginning of the dataset list of this dataset. | |
virtual void | AddLast (TDataSet *dataset) |
Add TDataSet object at the end of the dataset list of this dataset. | |
TDataSet * | At (Int_t idx) const |
virtual TObject * | Clone (const char *newname="") const |
the custom implementation fo the TObject::Clone | |
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 |
Aliase for TDataSet::Find(const Char_t *path) method. | |
virtual TDataSet * | FindByTitle (const char *title, const char *path="", Option_t *opt="") const |
TObject * | FindObject (const char *name) const |
TObject * | FindObject (const TObject *o) const |
virtual TDataSet * | First () const |
Return the first object in the list. Returns 0 when list is empty. | |
TObjArray * | GetObjArray () const |
virtual TSeqCollection * | GetCollection () const |
TList * | GetList () const |
virtual Int_t | GetListSize () const |
TObject * | GetMother () const |
virtual TObject * | GetObject () const |
The depricated method (left here for the sake of the backward compatibility) | |
virtual TDataSet * | GetParent () const |
virtual TDataSet * | Instance () const |
virtual TString | Path () const |
return the full path of this data set | |
virtual EDataSetPass | Pass (EDataSetPass(*callback)(TDataSet *), Int_t depth=0) |
virtual EDataSetPass | Pass (EDataSetPass(*callback)(TDataSet *, void *), void *user, Int_t depth=0) |
virtual void | Remove (TDataSet *set) |
Remiove the "set" from this TDataSet. | |
virtual TDataSet * | RemoveAt (Int_t idx) |
virtual void | SetMother (TDataSet *parent=0) |
virtual void | SetObject (TObject *obj) |
The depricated method (left here for the sake of the backward compatibility) | |
virtual void | SetParent (TDataSet *parent=0) |
virtual void | SetWrite () |
virtual void | Shunt (TDataSet *newParent=0) |
virtual void | Sort () |
Sort recursively all members of the TDataSet with TList::Sort method. | |
virtual Bool_t | IsEmpty () const |
return kTRUE if the "internal" collection has no member | |
virtual Bool_t | IsMarked () const |
virtual Bool_t | IsThisDir (const char *dirname, int len=-1, int ignorecase=0) const |
virtual TDataSet * | Last () const |
Return the last object in the list. Returns 0 when list is empty. | |
virtual void | ls (Option_t *option="") const |
virtual void | ls (Int_t depth) const |
void | Mark () |
void | UnMark () |
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. | |
void | Mark (UInt_t flag, EBitOpt reset=kSet) |
virtual TDataSet * | Next () const |
virtual TDataSet * | Prev () const |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) |
virtual Int_t | Write (const char *name=0, Int_t option=0, Int_t bufsize=0) const |
Static Public Member Functions | |
static TTableDescriptor * | MakeDescriptor (const char *structName) |
static const char * | TableDictionary () |
Static Public Member Functions inherited from TTable | |
static TTable * | New (const Char_t *name, const Char_t *type, void *array, UInt_t size) |
This static method creates a new TTable object if provided. | |
static const char * | GetTypeName (EColumnType type) |
return table type name | |
static EColumnType | GetTypeId (const char *typeName) |
static const char * | TableDictionary () |
Static Public Member Functions inherited from TDataSet | |
static TDataSet * | GetMainSet () |
return pointer to the main dataset | |
static TDataSet * | instance () |
Protected Member Functions | |
virtual void | Init (TClass *classPtr) |
virtual TTableDescriptor * | GetDescriptorPointer () const |
return column descriptor | |
virtual void | SetDescriptorPointer (TTableDescriptor *list) |
set table descriptor | |
Protected Member Functions inherited from TTable | |
Bool_t | BoundsOk (const char *where, Int_t at) const |
Bool_t | OutOfBoundsError (const char *where, Int_t i) const |
Generate an out-of-bounds error. Always returns false. | |
void | CopyStruct (Char_t *dest, const Char_t *src) |
Char_t * | Create () |
virtual void | Clear (Option_t *opt="") |
virtual void | Delete (Option_t *opt="") |
virtual Bool_t | EntryLoop (const Char_t *exprFileName, Int_t &action, TObject *obj, Int_t nentries=1000000000, Int_t firstentry=0, Option_t *option="") |
Int_t | SetfN (Long_t len) |
to be documented | |
void | SetTablePointer (void *table) |
to be documented | |
void | SetUsedRows (Int_t n) |
virtual void | SetType (const char *const type) |
to be documented | |
void | StreamerHeader (TBuffer &b, Version_t version=3) |
Read "table parameters first". | |
void | StreamerTable (TBuffer &b, Version_t version=3) |
Stream an object of class TTable. | |
void | ReAlloc (Int_t newsize) |
The table is reallocated if it is an owner of the internal array. | |
Protected Member Functions inherited from TDataSet | |
virtual void | SetMother (TObject *mother) |
TDataSet (const char *name, const char *title) | |
void | AddMain (TDataSet *set) |
add data set to main data set | |
TDataSet * | GetRealParent () |
return real parent | |
void | MakeCollection () |
Create the internal container at once if any. | |
Static Protected Member Functions | |
static void | SetCommentsSetName (const char *name=".comments") |
set comments name | |
Static Protected Member Functions inherited from TTable | |
static const char * | TableDictionary (const char *className, const char *structName, TTableDescriptor *&ColDescriptors) |
Static Protected Member Functions inherited from TDataSet | |
static EDataSetPass | SortIt (TDataSet *ds) |
static EDataSetPass | SortIt (TDataSet *ds, void *user) |
Protected Attributes | |
TClass * | fRowClass |
TTableDescriptor * | fSecondDescriptor |
Protected Attributes inherited from TTable | |
Long_t | fSize |
Int_t | fN |
Char_t * | fTable |
Long_t | fMaxIndex |
Protected Attributes inherited from TDataSet | |
TDataSet * | fParent |
TSeqCollection * | fList |
Static Protected Attributes | |
static TString | fgCommentsName = ".comments" |
static TTableDescriptor * | fgColDescriptors = 0 |
Static Protected Attributes inherited from TDataSet | |
static TDataSet * | fgMainSet = &mainSet |
Friends | |
class | TTable |
Additional Inherited Members | |
Static Public Attributes inherited from TTable | |
static const char * | fgTypeName [kEndColumnType] |
Definition at line 25 of file TTableDescriptor.h.
TTableDescriptor::TTableDescriptor | ( | TClass * | classPtr | ) |
Create a descriptor of the C-structure defined by TClass TClass *classPtr must be a valid pointer to TClass object for "plain" C_struture only !!!
Definition at line 86 of file TTableDescriptor.cxx.
References Init(), and TTableDescriptor().
|
virtual |
Add the descriptor element followed by its commentText at the indx-th position of the descriptor (counted from zero)
Definition at line 153 of file TTableDescriptor.cxx.
References TTable::AddAt(), TDataSet::AddAtAndExpand(), and MakeCommentField().
|
virtual |
Add one dataset to the descriptor. There is no new implementation here. One needs it to avoid the "hidden method" compilation warning
Reimplemented from TTable.
Definition at line 144 of file TTableDescriptor.cxx.
References TTable::AddAt().
|
protectedvirtual |
Create a descriptor of the C-structure defined by TClass TClass *classPtr must be a valid pointer to TClass object for "plain" C_structure only !!!
Definition at line 214 of file TTableDescriptor.cxx.
References LearnTable(), and TTable::SetType().
Referenced by TTableDescriptor().
void TTableDescriptor::LearnTable | ( | TClass * | classPtr | ) |
LearnTable() creates an array of the descriptors for elements of the row
It creates a descriptor of the C-structure defined by TClass TClass *classPtr must be a valid pointer to TClass object for "plain" C-structure only !!!
This is to introduce an artificial restriction demanded by STAR database group
To lift this restriction one has to provide -DNORESTRICTIONS CPP symbol and recompile code (and debug code NOW!)
Definition at line 255 of file TTableDescriptor.cxx.
References AddAt(), TTable::GetTypeId(), and TTable::ReAllocate().
|
static |
MakeDescriptor(const char *structName) - static method structName - the name of the C structure to create descriptor of return a new instance of the TTableDescriptor or 0 if the "structName is not present with the dictionary
Definition at line 328 of file TTableDescriptor.cxx.
Referenced by TGenericTable::TGenericTable().
Int_t TTableDescriptor::Offset | ( | const Char_t * | columnName = 0 | ) | const |
Return offset of the column defined by "columnName" Take in account index if provided Can not handle multidimensional indeces yet.
Definition at line 434 of file TTableDescriptor.cxx.
References ColumnByName().
|
virtual |
"Schema evolution"
Method updates the offsets with a new ones from another descriptor
Definition at line 351 of file TTableDescriptor.cxx.
References ColumnByName(), and TTable::GetNRows().