35 while ((ob = next())) {
36 if (ob->
IsEqual(obj))
return idx;
57 if (!
a && !
b)
return 0;
77 while (last - first > 1) {
99 if (j - first < last - (j + 1)) {
125 static int depth = 0;
126 if (depth == 0 && nBs > 0) tmp2 =
new TObject*[nBs];
129 while (last - first > 1) {
134 while (--j > first &&
ObjCompare(
a[j],
a[first]) > 0) {}
137 tmp1 =
a[i];
for(k=0;k<nBs;k++) tmp2[k] =
b[k][i];
138 a[i] =
a[j];
for(k=0;k<nBs;k++)
b[k][i] =
b[k][j];
139 a[j] = tmp1;
for(k=0;k<nBs;k++)
b[k][j] = tmp2[k];
145 tmp1 =
a[first];
for(k=0;k<nBs;k++) tmp2[k] =
b[k][first];
146 a[first] =
a[j];
for(k=0;k<nBs;k++)
b[k][first] =
b[k][j];
147 a[j] = tmp1;
for(k=0;k<nBs;k++)
b[k][j] = tmp2[k];
148 if (j - first < last - (j + 1)) {
158 if (depth == 0 && nBs > 0)
delete [] tmp2;
188 Warning(
"Merge",
"list is empty - nothing to merge");
191 if (list->IsEmpty()) {
192 Warning(
"Merge",
"input list is empty - nothing to merge with");
195 TIter nextobject(
this);
196 TIter nextlist(list);
205 while ((
object = nextobject())) {
225 while ((collcrt = nextlist())) {
227 Error(
"Merge",
"some objects in the input list are not collections - merging aborted");
239 Warning(
"Merge",
"object of type %s (position %d in list) not found in list %d. Continuing...",
240 object->ClassName(), indobj, indcoll);
252 if (
object->IsA() != objtomerge->
IsA()) {
253 Error(
"Merge",
"object of type %s at index %d not matching object of type %s in input list",
260 templist->
Add(objtomerge);
264 if (!notmergeable &&
IsA())
267 notmergeable->
Add(objtomerge);
269 Warning(
"Merge",
"temp list for non mergeable objects not created!");
282 if (notmergeable && notmergeable->
GetSize() > 0) {
283 TIter nxnm(notmergeable);
284 while (
auto onm = nxnm())
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
bool Bool_t
Boolean (0=false, 1=true) (bool).
long long Long64_t
Portable signed long integer 8 bytes.
externTVirtualMutex * gCollectionMutex
#define R__LOCKGUARD2(mutex)
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
TCollection(const TCollection &)=delete
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual Bool_t IsEmpty() const
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
Method or function calling interface.
void Execute(const char *, const char *, int *=nullptr) override
Execute method on this object with the given parameter string, e.g.
Bool_t IsValid() const
Return true if the method call has been properly initialized and is usable.
void InitWithPrototype(TClass *cl, const char *method, const char *proto, Bool_t objectIsConst=kFALSE, ROOT::EFunctionMatchMode mode=ROOT::kConversionMatch)
Initialize the method invocation environment.
void SetParam(Long_t l)
Add a long method parameter.
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 * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TClass * IsA() const
TObject()
TObject constructor.
virtual Int_t IndexOf(const TObject *obj) const
Return index of object in collection.
TClass * IsA() const override
virtual TObject * Last() const =0
static void QSort(TObject **a, Int_t first, Int_t last)
Sort array of TObject pointers using a quicksort algorithm.
Long64_t Merge(TCollection *list)
Merge this collection with all collections coming in the input list.
virtual Int_t GetLast() const
Returns index of last object in collection.
static Int_t ObjCompare(TObject *a, TObject *b)
Compare to objects in the collection. Use member Compare() of object a.
void Add(TObject *obj) override