12 #ifndef ROOT_TObjArray 13 #define ROOT_TObjArray 29 #if (__GNUC__ >= 3) && !defined(__INTEL_COMPILER) 32 #pragma GCC system_header 109 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 110 #pragma GCC diagnostic push 111 #pragma GCC diagnostic ignored "-Weffc++" 123 public std::iterator<std::bidirectional_iterator_tag,
124 TObject*, std::ptrdiff_t,
125 const TObject**, const TObject*&> {
152 #if (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) >= 40600 153 #pragma GCC diagnostic pop 160 return (at < fLowerBound || at-fLowerBound >=
fSize)
TObjArray(Int_t s=TCollection::kInitCapacity, Int_t lowerBound=0)
Create an object array.
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.
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.
virtual void AddFirst(TObject *obj)
Add object in the first slot of the array.
TObject * At(Int_t idx) const
TObject ** GetObjectRef() const
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.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
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 TObject * FindObject(const char *name) const
Find an object in this collection using its name.
virtual void AddAfter(const TObject *after, TObject *obj)
Add object in the slot after object after.
Bool_t OutOfBoundsError(const char *where, Int_t i) const
Generate an out-of-bounds error. Always returns false.
virtual ~TObjArray()
Delete an array.
TObjArray & operator=(const TObjArray &)
Assignment operator. Note, unsets the kIsOwner flag.
const Bool_t kIterForward
virtual Int_t BinarySearch(TObject *obj, Int_t upto=kMaxInt)
Find object using a binary search.
Bool_t operator!=(const TDatime &d1, const TDatime &d2)
TObject * First() const
Return the object in the first slot.
Int_t GetLast() const
Return index of last object in array.
friend class TObjArrayIter
virtual void AddAtAndExpand(TObject *obj, Int_t idx)
Add object at position idx.
virtual TObject * RemoveAt(Int_t idx)
Remove object at index idx.
TTime operator*(const TTime &t1, const TTime &t2)
Collection abstract base class.
Int_t GetEntriesFast() const
void Init(Int_t s, Int_t lowerBound)
Initialize a TObjArray.
void Reset(Detail::TBranchProxy *x)
virtual void AddAt(TObject *obj, Int_t idx)
Add object at position ids.
Int_t fLowerBound
Array contents.
Bool_t BoundsOk(const char *where, Int_t at) const
Int_t GetAbsLast() const
Return absolute index to last object in array.
TIterator * MakeIterator(Bool_t dir=kIterForward) const
Returns an array iterator.
TObject * UncheckedAt(Int_t i) const
Int_t IndexOf(const TObject *obj) const
virtual void Expand(Int_t newSize)
Expand or shrink the array to newSize elements.
static constexpr double s
TObject * Before(const TObject *obj) const
Return the object before obj. Returns 0 if obj is first object.
Mother of all ROOT objects.
const TCollection * GetCollection() const
An array of clone (identical) objects.
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
Int_t GetEntries() const
Return the number of objects in array (i.e.
TObject * After(const TObject *obj) const
Return the object after obj. Returns 0 if obj is last object.
virtual void AddLast(TObject *obj)
Add object in the next empty slot in the array.
virtual void Compress()
Remove empty slots from array.
virtual void AddBefore(const TObject *before, TObject *obj)
Add object in the slot before object before.