37 if (ob->
IsEqual(obj))
return idx;
58 if (a == 0 && b == 0)
return 0;
60 if (b == 0)
return -1;
78 while (last - first > 1) {
82 while (++i < last &&
ObjCompare(a[i], a[first]) < 0)
84 while (--j > first &&
ObjCompare(a[j], a[first]) > 0)
100 if (j - first < last - (j + 1)) {
104 QSort(a, j + 1, last);
126 static int depth = 0;
127 if (depth == 0 && nBs > 0) tmp2 =
new TObject*[nBs];
130 while (last - first > 1) {
134 while (++i < last &&
ObjCompare(a[i], a[first]) < 0) {}
135 while (--j > first &&
ObjCompare(a[j], a[first]) > 0) {}
138 tmp1 = a[i];
for(k=0;k<nBs;k++) tmp2[k] = b[k][i];
139 a[i] = a[j];
for(k=0;k<nBs;k++) b[k][i] = b[k][j];
140 a[j] = tmp1;
for(k=0;k<nBs;k++) b[k][j] = tmp2[k];
146 tmp1 = a[
first];
for(k=0;k<nBs;k++) tmp2[k] = b[k][first];
147 a[
first] = a[j];
for(k=0;k<nBs;k++) b[k][first] = b[k][j];
148 a[j] = tmp1;
for(k=0;k<nBs;k++) b[k][j] = tmp2[k];
149 if (j - first < last - (j + 1)) {
150 QSort(a, nBs, b, first, j);
153 QSort(a, nBs, b, j + 1, last);
159 if (depth == 0 && nBs > 0)
delete [] tmp2;
189 Warning(
"Merge",
"list is empty - nothing to merge");
193 Warning(
"Merge",
"input list is empty - nothing to merge with");
196 TIter nextobject(
this);
197 TIter nextlist(list);
206 while ((
object = nextobject())) {
209 if (!object->IsA()) {
226 while ((collcrt = nextlist())) {
228 Error(
"Merge",
"some objects in the input list are not collections - merging aborted");
236 Warning(
"Merge",
"object of type %s (position %d in list) not found in list %d. Continuing...",
249 if (object->IsA() != objtomerge->IsA()) {
250 Error(
"Merge",
"object of type %s at index %d not matching object of type %s in input list",
257 templist->
Add(objtomerge);
261 if (!notmergeable &&
IsA())
264 notmergeable->
Add(objtomerge);
266 Warning(
"Merge",
"temp list for non mergeable objects not created!");
279 if (notmergeable && notmergeable->
GetSize() > 0) {
280 TIter nxnm(notmergeable);
282 while ((onm = nxnm())) {
Add(onm->
Clone()); }
virtual void Add(TObject *obj)
R__EXTERN TVirtualMutex * gCollectionMutex
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
virtual TObject * Clone(const char *newname="") const
Make a clone of an object using the Streamer facility.
Sequenceable collection abstract base class.
virtual Bool_t IsEmpty() const
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
Method or function calling interface.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
Collection abstract base class.
static void QSort(TObject **a, Int_t first, Int_t last)
Sort array of TObject pointers using a quicksort algorithm.
void InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Initialize the method invocation environment.
virtual Int_t GetLast() const
Returns index of last object in collection.
virtual Int_t GetSize() const
Mother of all ROOT objects.
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
void SetParam(Long_t l)
Add a long method parameter.
virtual Int_t Compare(const TObject *obj) const
Compare abstract method.
virtual Int_t IndexOf(const TObject *obj) const
static Int_t ObjCompare(TObject *a, TObject *b)
Compare to objects in the collection. Use member Compare() of object a.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
Long64_t Merge(TCollection *list)
Merge this collection with all collections coming in the input list.
virtual TObject * Last() const =0
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.