12 #ifndef ROOT_TObjArray
13 #define ROOT_TObjArray
25 #ifndef ROOT_TSeqCollection
31 #if (__GNUC__ >= 3) && !defined(__INTEL_COMPILER)
34 #pragma GCC system_header
111 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
112 #pragma GCC diagnostic push
113 #pragma GCC diagnostic ignored "-Weffc++"
125 public std::iterator<std::bidirectional_iterator_tag,
126 TObject*, std::ptrdiff_t,
127 const TObject**, const TObject*&> {
154 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600
155 #pragma GCC diagnostic pop
162 return (at < fLowerBound || at-fLowerBound >=
fSize)
TObjArray(Int_t s=TCollection::kInitCapacity, Int_t lowerBound=0)
virtual Int_t AddAtFree(TObject *obj)
Return the position of the new object.
virtual void Sort(Int_t upto=kMaxInt)
If objects in array are sortable (i.e.
virtual void Clear(Option_t *option="")
Remove all objects from the array.
Int_t GetLast() const
Return index of last object in array.
virtual void Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
virtual TObject * Remove(TObject *obj)
Remove object from array.
virtual void Randomize(Int_t ntimes=1)
Randomize objects inside the array, i.e.
Iterator of object array.
Int_t GetEntriesFast() const
virtual void AddFirst(TObject *obj)
Add object in the first slot of the array.
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
Iterator abstract base class.
virtual void RemoveRange(Int_t idx1, Int_t idx2)
Remove objects from index idx1 to idx2 included.
virtual TObject *& operator[](Int_t i)
Return the object at position i.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
Sequenceable collection abstract base class.
#define ClassDef(name, id)
void SetLast(Int_t last)
Set index of last object in array, effectively truncating the array.
virtual void AddAfter(const TObject *after, TObject *obj)
Add object in the slot after object after.
virtual ~TObjArray()
Delete an array.
std::map< std::string, std::string >::const_iterator iter
TObjArray & operator=(const TObjArray &)
Assignment operator. Note, unsets the kIsOwner flag.
TObject * Next()
Return next object in array. Returns 0 when no more objects in array.
void Reset()
Reset array iterator.
const Bool_t kIterForward
virtual Int_t BinarySearch(TObject *obj, Int_t upto=kMaxInt)
Find object using a binary search.
TObject * First() const
Return the object in the first slot.
TObject * UncheckedAt(Int_t i) const
Int_t IndexOf(const TObject *obj) const
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
Bool_t operator!=(const TIterator &aIter) const
This operator compares two TIterator objects.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
Collection abstract base class.
TObject * Before(const TObject *obj) const
Return the object before obj. Returns 0 if obj is first object.
void Init(Int_t s, Int_t lowerBound)
Initialize a TObjArray.
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
Int_t fLowerBound
Array contents.
TIterator & operator=(const TIterator &rhs)
Overridden assignment operator.
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * operator*() const
Return current object or nullptr.
Mother of all ROOT objects.
Bool_t OutOfBoundsError(const char *where, Int_t i) const
Generate an out-of-bounds error. Always returns false.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
An array of clone (identical) objects.
TObject * After(const TObject *obj) const
Return the object after obj. Returns 0 if obj is last object.
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
TObject ** GetObjectRef() const
Int_t GetAbsLast() const
Return absolute index to last object in array.
TObject * At(Int_t idx) const
virtual void Compress()
Remove empty slots from array.
const TCollection * GetCollection() const
Bool_t BoundsOk(const char *where, Int_t at) const
virtual void AddBefore(const TObject *before, TObject *obj)
Add object in the slot before object before.