ROOT logo
ROOT » CORE » CONT » TOrdCollection

class TOrdCollection: public TSeqCollection


Ordered collection. An ordered collection has TList insertion
semantics but is implemented using an array of TObject*'s. It uses
less space than a TList (since there is no need for the prev and
next pointers), but it is more costly to insert objects (since it
has to create a gap by copying object pointers). TOrdCollection
is better than TList when objects are only added at the end of the
collection since no copying needs to be done.

/* */

Function Members (Methods)

TOrdCollection(Int_t capacity = kDefaultCapacity)
voidTObject::AbstractMethod(const char* method) const
virtual voidTSeqCollection::Add(TObject* obj)
virtual voidAddAfter(const TObject* after, TObject* obj)
virtual voidTCollection::AddAll(const TCollection* col)
virtual voidAddAt(TObject* obj, Int_t idx)
virtual voidAddBefore(const TObject* before, TObject* obj)
virtual voidAddFirst(TObject* obj)
virtual voidAddLast(TObject* obj)
voidTCollection::AddVector(TObject* obj1)
virtual TObject*After(const TObject* obj) const
virtual voidTObject::AppendPad(Option_t* option = "")
Bool_tTCollection::AssertClass(TClass* cl) const
virtual TObject*At(Int_t idx) const
virtual TObject*Before(const TObject* obj) const
Int_tBinarySearch(TObject* obj)
virtual voidTCollection::Browse(TBrowser* b)
Int_tTCollection::Capacity() const
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidClear(Option_t* option = "")
virtual TObject*TCollection::Clone(const char* newname = "") const
virtual Int_tTCollection::Compare(const TObject* obj) const
Bool_tTCollection::Contains(const char* name) const
Bool_tTCollection::Contains(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidDelete(Option_t* option = "")
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTCollection::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTCollection::Dump() const
static voidTCollection::EmptyGarbageCollection()
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 TObject*TCollection::FindObject(const char* name) const
virtual TObject*TCollection::FindObject(const TObject* obj) const
virtual TObject*First() const
static voidTCollection::GarbageCollect(TObject* obj)
static TCollection*TCollection::GetCurrentCollection()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual Int_tTCollection::GetEntries() const
virtual const char*TObject::GetIconName() const
virtual Int_tTSeqCollection::GetLast() const
virtual const char*TCollection::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
virtual TObject**GetObjectRef(const TObject* obj) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual Int_tTCollection::GetSize() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Int_tTCollection::GrowBy(Int_t delta) const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTCollection::Hash() const
virtual Int_tIndexOf(const TObject* obj) 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
Bool_tTCollection::IsArgNull(const char* where, const TObject* obj) const
virtual Bool_tTCollection::IsEmpty() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTCollection::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tTCollection::IsOwner() const
virtual Bool_tTCollection::IsSortable() const
virtual Bool_tTSeqCollection::IsSorted() const
Bool_tTObject::IsZombie() const
virtual TObject*Last() const
Int_tTSeqCollection::LastIndex() const
virtual voidTCollection::ls(Option_t* option = "") const
virtual TIterator*MakeIterator(Bool_t dir = kIterForward) const
virtual TIterator*TCollection::MakeReverseIterator() const
voidTObject::MayNotUse(const char* method) const
Long64_tTSeqCollection::Merge(TCollection* list)
virtual Bool_tTObject::Notify()
static Int_tTSeqCollection::ObjCompare(TObject* a, TObject* b)
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)
TObject*TCollection::operator()(const char* name) const
virtual voidTCollection::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTCollection::Print(Option_t* option = "") const
virtual voidTCollection::Print(Option_t* option, Int_t recurse) const
virtual voidTCollection::Print(Option_t* option, const char* wildcard, Int_t recurse = 1) const
virtual voidTCollection::Print(Option_t* option, TPRegexp& regexp, Int_t recurse = 1) const
voidPutAt(TObject* obj, Int_t idx)
static voidTSeqCollection::QSort(TObject** a, Int_t first, Int_t last)
static voidTSeqCollection::QSort(TObject** a, TObject** b, Int_t first, Int_t last)
static voidTSeqCollection::QSort(TObject** a, Int_t nBs, TObject*** b, Int_t first, Int_t last)
virtual Int_tTObject::Read(const char* name)
virtual voidTCollection::RecursiveRemove(TObject* obj)
virtual TObject*Remove(TObject* obj)
virtual voidTSeqCollection::RemoveAfter(TObject* after)
virtual voidTCollection::RemoveAll(TCollection* col)
virtual TObject*RemoveAt(Int_t idx)
virtual voidTSeqCollection::RemoveBefore(TObject* before)
virtual voidTSeqCollection::RemoveFirst()
virtual voidTSeqCollection::RemoveLast()
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)
voidTCollection::SetName(const char* name)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTCollection::SetOwner(Bool_t enable = kTRUE)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp)
static voidTCollection::StartGarbageCollection()
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_tTCollection::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTCollection::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
virtual voidTSeqCollection::Changed()
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual const char*TCollection::GetCollectionEntryName(TObject* entry) const
virtual voidTCollection::PrintCollectionEntry(TObject* entry, Option_t* option, Int_t recurse) const
virtual voidTCollection::PrintCollectionHeader(Option_t* option) const
TOrdCollection(const TOrdCollection&)
Bool_tIllegalIndex(const char* method, Int_t idx) const
voidInit(Int_t capacity)
Int_tLogIndex(Int_t idx) const
Bool_tLowWaterMark() const
voidMoveGapTo(Int_t newGapStart)
TOrdCollection&operator=(const TOrdCollection&)
Int_tPhysIndex(Int_t idx) const
voidSetCapacity(Int_t newCapacity)

Data Members

enum { kDefaultCapacity
enum TCollection::[unnamed] { kIsOwner
enum TObject::EStatusBits { kCanDelete
enum TObject::[unnamed] { kIsOnHeap
TStringTCollection::fNamename of the collection
Int_tTCollection::fSizenumber of elements in collection
Bool_tTSeqCollection::fSortedtrue if collection has been sorted

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TOrdCollection(Int_t capacity = kDefaultCapacity)
 Create an ordered collection.
 Delete the collection. Objects are not deleted unless the TOrdCollection
 is the owner (set via SetOwner()).
void AddAt(TObject* obj, Int_t idx)
 Insert object at position idx in the collection.
void AddFirst(TObject* obj)
 Insert object at beginning of collection.
void AddLast(TObject* obj)
 Add object at the end of the collection.
void AddBefore(const TObject* before, TObject* obj)
 Insert object before object before in the collection.
void AddAfter(const TObject* after, TObject* obj)
 Insert object after object after in the collection.
TObject * After(const TObject* obj) const
 Return the object after object obj. Returns 0 if obj is last
 in collection.
TObject * At(Int_t idx) const
 Returns the object at position idx. Returns 0 if idx is out of range.
TObject * Before(const TObject* obj) const
 Returns the object before object obj. Returns 0 if obj is first
 in collection.
void Clear(Option_t* option = "")
 Remove all objects from the collection. Does not delete the objects
 unless the TOrdCollection is the owner (set via SetOwner()).
void Delete(Option_t* option = "")
 Remove all objects from the collection AND delete all heap based objects.
TObject * First() const
 Return the first object in the collection. Returns 0 when collection
 is empty.
TObject ** GetObjectRef(const TObject* obj) const
 return address of pointer obj
TObject * Last() const
 Return the last object in the collection. Returns 0 when collection
 is empty.
Bool_t IllegalIndex(const char* method, Int_t idx) const
 Return true when index out of bounds and print error.
Int_t IndexOf(const TObject* obj) const
 Return index of object in collection. Returns -1 when object not found.
 Uses member IsEqual() to find object.
void Init(Int_t capacity)
 Initialize ordered collection.
TIterator * MakeIterator(Bool_t dir = kIterForward) const
 Return an ordered collection iterator.
void MoveGapTo(Int_t newGapStart)
 Move gap to new position. Gap needs to be moved when objects are
 inserted not at the end.
void PutAt(TObject* obj, Int_t idx)
 Put object at index idx. Overwrites what was at idx before.
TObject * RemoveAt(Int_t idx)
 Remove object at index idx.
TObject * Remove(TObject* obj)
 Remove object from collection.
void SetCapacity(Int_t newCapacity)
 Set/change ordered collection capacity.
void Sort()
 If objects in collection are sortable (i.e. IsSortable() returns true
 for all objects) then sort collection.
Int_t BinarySearch(TObject* obj)
 Find object using a binary search. Collection must first have been
Bool_t LowWaterMark() const
Int_t PhysIndex(Int_t idx) const
{ return (idx < fGapStart) ? idx : idx + fGapSize; }
Int_t LogIndex(Int_t idx) const
{ return (idx < fGapStart) ? idx : idx - fGapSize; }
TOrdCollection(const TOrdCollection& )
TOrdCollection& operator=(const TOrdCollection& )