67 Warning(
"TObjArray",
"size (%d) < 0", s);
81 Init(
a.fSize,
a.fLowerBound);
116 Init(
a.fSize,
a.fLowerBound);
136 if (j >= 0 && j <
fSize) {
198 Error(
"AddBefore",
"before not found, object not added");
224 Error(
"AddAfter",
"after not found, object not added");
240 Error(
"AddAt",
"out of bounds at %d in %zx", idx, (
size_t)
this);
258 if (!
BoundsOk(
"AddAt", idx))
return;
275 for (i = 0; i <
fSize; i++)
292 if (!obj)
return nullptr;
297 if (idx == -1 || idx ==
fSize-1)
return nullptr;
307 if (!obj)
return nullptr;
312 if (idx == -1 || idx == 0)
return nullptr;
349 for ( ; j <
fSize; j++)
392 Error (
"Expand",
"newSize must be positive (%d)", newSize);
395 if (newSize ==
fSize)
397 if (newSize <
fSize) {
401 Error (
"Expand",
"expand would cut off nonempty entries at %d", j);
420 for (
Int_t i = 0; i < nobjects; ++i) {
422 if (obj && 0 == strcmp(
name, obj->
GetName()))
return obj;
439 for (
Int_t i = 0; i < nobjects; ++i) {
441 if (obj && obj->
IsEqual(iobj))
return obj;
467 for (
Int_t i = 0; i < nobjects; i++) {
486 for (
Int_t i = 0; i < nobjects; i++) {
489 b.SetByteCount(R__c,
kTRUE);
612 for (i = 0; i <
fSize; i++)
616 for (i = 0; i <
fSize; i++)
660 Error(where,
"index %d out of bounds (size: %d, this: 0x%zx)", i,
fSize, (
size_t)
this);
677 for (
int i = 0; i <
fSize; i++) {
696 if (!
BoundsOk(
"RemoveAt", idx))
return nullptr;
721 if (!obj)
return nullptr;
727 if (idx == -1)
return nullptr;
730 fCont[idx] =
nullptr;
745 if (!
BoundsOk(
"RemoveRange", idx1))
return;
746 if (!
BoundsOk(
"RemoveRange", idx2))
return;
763 if (idx1 < fLast || fLast > idx2)
return;
779 if (last == -2 || last == -1)
799 for (
Int_t i = 0; i < ntimes; i++) {
806 if (k == j)
continue;
826 Error(
"Sort",
"objects in array are not sortable");
851 Error(
"BinarySearch",
"array must first be sorted");
858 while (last >= base) {
859 position = (base+last) / 2;
860 op2 =
fCont[position];
938 if (fCursor < fArray->Capacity()) {
991 return (((
fCurCursor >= 0) && (fCurCursor < fArray->Capacity())) ?
#define R__unlikely(expr)
#define R__COLLECTION_READ_LOCKGUARD(mutex)
const Bool_t kIterForward
#define R__COLLECTION_WRITE_LOCKGUARD(mutex)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Buffer base class used for serializing objects.
virtual Int_t GrowBy(Int_t delta) const
Increase the collection's capacity by delta slots.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
static void GarbageCollect(TObject *obj)
Add to the list of things to be cleaned up.
Bool_t IsSortable() const override
Iterator abstract base class.
virtual TClass * IsA() const
Iterator of object array.
TIterator & operator=(const TIterator &rhs) override
Overridden assignment operator.
Bool_t operator!=(const TIterator &aIter) const override
This operator compares two TIterator objects.
TObject * operator*() const override
Return current object or nullptr.
TObject * Next() override
Return next object in array. Returns 0 when no more objects in array.
void Reset() override
Reset array iterator.
virtual Int_t AddAtFree(TObject *obj)
Return the position of the new object.
TObjArray & operator=(const TObjArray &)
Assignment operator. Note, unsets the kIsOwner flag.
Int_t GetEntriesFast() const
Int_t IndexOf(const TObject *obj) const override
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
Int_t GetEntriesUnsafe() const
Return the number of objects in array (i.e.
virtual TObject *& operator[](Int_t i)
Return the object at position i.
TObject ** GetObjectRef() const
virtual ~TObjArray()
Delete an array.
void AddAt(TObject *obj, Int_t idx) override
Add object at position ids.
TObject * Last() const override
Return the object in the last filled slot. Returns 0 if no entries.
void Init(Int_t s, Int_t lowerBound)
Initialize a TObjArray.
virtual void Sort(Int_t upto=kMaxInt)
If objects in array are sortable (i.e.
void Clear(Option_t *option="") override
Remove all objects from the array.
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
void AddAfter(const TObject *after, TObject *obj) override
Add object in the slot after object after.
void Streamer(TBuffer &) override
Stream all objects in the array to or from the I/O buffer.
TIterator * MakeIterator(Bool_t dir=kIterForward) const override
Returns an array iterator.
virtual void Compress()
Remove empty slots from array.
Int_t GetEntries() const override
Return the number of objects in array (i.e.
Bool_t BoundsOk(const char *where, Int_t at) const
void Delete(Option_t *option="") override
Remove all objects from the array AND delete all heap based objects.
Bool_t OutOfBoundsError(const char *where, Int_t i) const
Generate an out-of-bounds error. Always returns false.
virtual Int_t BinarySearch(TObject *obj, Int_t upto=kMaxInt)
Find object using a binary search.
void AddLast(TObject *obj) override
Add object in the next empty slot in the array.
TObject * First() const override
Return the object in the first slot.
Int_t fLowerBound
Array contents.
TObject * Remove(TObject *obj) override
Remove object from array.
Int_t GetAbsLast() const
Return absolute index to last object in array.
void SetLast(Int_t last)
Set index of last object in array, effectively truncating the array.
TObject * RemoveAt(Int_t idx) override
Remove object at index idx.
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
virtual void Randomize(Int_t ntimes=1)
Randomize objects inside the array, i.e.
TObject * After(const TObject *obj) const override
Return the object after obj. Returns 0 if obj is last object.
TObject * Before(const TObject *obj) const override
Return the object before obj. Returns 0 if obj is first object.
virtual void RemoveRange(Int_t idx1, Int_t idx2)
Remove objects from index idx1 to idx2 included.
Int_t GetLast() const override
Return index of last object in array.
TClass * IsA() const override
TObjArray(Int_t s=TCollection::kInitCapacity, Int_t lowerBound=0)
Create an object array.
void AddFirst(TObject *obj) override
Add object in the first slot of the array.
void RecursiveRemove(TObject *obj) override
Remove object from this collection and recursively remove the object from all other objects (and coll...
friend class TObjArrayIter
void AddBefore(const TObject *before, TObject *obj) override
Add object in the slot before object before.
Mother of all ROOT objects.
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
virtual const char * GetName() const
Returns name of object.
virtual void RecursiveRemove(TObject *obj)
Recursively remove this object from a list.
virtual void Streamer(TBuffer &)
Stream an object of class TObject.
R__ALWAYS_INLINE Bool_t IsOnHeap() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
Sequenceable collection abstract base class.
static void QSort(TObject **a, Int_t first, Int_t last)
Sort array of TObject pointers using a quicksort algorithm.
static void * Alloc(size_t size)
Allocate a block of memory, that later can be resized using TStorage::ReAlloc().
static void Dealloc(void *ptr)
De-allocate block of memory, that was allocated via TStorage::Alloc().
static void * ReAlloc(void *vp, size_t size, size_t oldsize)
Reallocate (i.e.
virtual void Streamer(TBuffer &)
Stream a string object.
R__ALWAYS_INLINE bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
R__EXTERN TVirtualRWMutex * gCoreMutex
Short_t Max(Short_t a, Short_t b)
Returns the largest of a and b.
Short_t Min(Short_t a, Short_t b)
Returns the smallest of a and b.