library: libCore #include "TOrdCollection.h" |
TOrdCollection
class description - header file - source file - inheritance tree (.pdf)
private:
Bool_t IllegalIndex(const char* method, Int_t idx) const
void Init(Int_t capacity)
Int_t LogIndex(Int_t idx) const
Bool_t LowWaterMark() const
void MoveGapTo(Int_t newGapStart)
Int_t PhysIndex(Int_t idx) const
void SetCapacity(Int_t newCapacity)
public:
TOrdCollection(Int_t capacity = kDefaultCapacity)
TOrdCollection(const TOrdCollection&)
~TOrdCollection()
virtual void AddAfter(const TObject* after, TObject* obj)
virtual void AddAt(TObject* obj, Int_t idx)
virtual void AddBefore(const TObject* before, TObject* obj)
virtual void AddFirst(TObject* obj)
virtual void AddLast(TObject* obj)
virtual TObject* After(const TObject* obj) const
virtual TObject* At(Int_t idx) const
virtual TObject* Before(const TObject* obj) const
Int_t BinarySearch(TObject* obj)
static TClass* Class()
virtual void Clear(Option_t* option = "")
virtual void Delete(Option_t* option = "")
virtual TObject* First() const
virtual TObject** GetObjectRef(const TObject* obj) const
virtual Int_t IndexOf(const TObject* obj) const
virtual TClass* IsA() const
virtual TObject* Last() const
virtual TIterator* MakeIterator(Bool_t dir = kIterForward) const
void PutAt(TObject* obj, Int_t idx)
virtual TObject* Remove(TObject* obj)
virtual TObject* RemoveAt(Int_t idx)
virtual void ShowMembers(TMemberInspector& insp, char* parent)
void Sort()
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
private:
TObject** fCont
Int_t fCapacity
Int_t fGapStart
Int_t fGapSize
public:
static const enum TOrdCollection:: kDefaultCapacity
static const enum TOrdCollection:: kMinExpand
static const enum TOrdCollection:: kShrinkFactor
TOrdCollection
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.
TObject * After(const TObject *obj)
Return the object after object obj. Returns 0 if obj is last
in collection.
TObject * At(Int_t idx)
Returns the object at position idx. Returns 0 if idx is out of range.
TObject * Before(const TObject *obj)
Returns the object before object obj. Returns 0 if obj is first
in collection.
TObject * First()
Return the first object in the collection. Returns 0 when collection
is empty.
TObject * Last()
Return the last object in the collection. Returns 0 when collection
is empty.
Int_t IndexOf(const TObject *obj)
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.
void MoveGapTo(Int_t start)
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.
void Sort()
If objects in collection are sortable (i.e. IsSortable() returns true
for all objects) then sort collection.
Author: Fons Rademakers 13/09/95
Last update: root/cont:$Name: $:$Id: TOrdCollection.cxx,v 1.13 2006/04/19 08:22:22 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
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.