Changeset 984 for trunk/MagicSoft/Mars/mbase
- Timestamp:
- 10/24/01 13:57:43 (23 years ago)
- Location:
- trunk/MagicSoft/Mars/mbase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mbase/MParList.cc
r959 r984 457 457 // from 1 to from. 458 458 // 459 TObjArray MParList::FindObjectList(const char *name, const UInt_t from, const UInt_t to) const459 TObjArray MParList::FindObjectList(const char *name, UInt_t first, const UInt_t last) const 460 460 { 461 461 TObjArray list; 462 462 463 if ( to>0 && to<=from)464 { 465 *fLog << dbginf << "Cannot create entries backwards ( to<from)...skipped." << endl;463 if (first>0 && last<first) 464 { 465 *fLog << dbginf << "Cannot create entries backwards (last<first)...skipped." << endl; 466 466 return list; 467 467 } … … 472 472 strcpy(auxname, name); 473 473 474 if (first==0 && last!=0) 475 first = 1; 476 474 477 // 475 478 // If only 'from' is specified the number of entries are ment 476 479 // 477 const Bool_t exc = from>0 && to==0; 478 479 const UInt_t first = exc ? 0 : from; 480 const UInt_t last = exc ? from : to; 481 482 for (UInt_t num=first; num<last; num++) 483 { 484 if (from!=0 || to!=0) 485 sprintf(auxname+len, ";%d", num+1); 480 for (UInt_t i=first; i<=last; i++) 481 { 482 if (first!=0 || last!=0) 483 sprintf(auxname+len, ";%d", i); 486 484 487 485 TObject *obj = FindObject(auxname); … … 505 503 // from 1 to from. 506 504 // 507 TObjArray MParList::FindCreateObjList(const char *cname, const UInt_t from, const UInt_t to, const char *oname)505 TObjArray MParList::FindCreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname) 508 506 { 509 507 TObjArray list; 510 508 511 if ( to>0 && to<=from)512 { 513 *fLog << dbginf << "Cannot create entries backwards ( to<from)...skipped." << endl;509 if (first>0 && last<first) 510 { 511 *fLog << dbginf << "Cannot create entries backwards (last<first)...skipped." << endl; 514 512 return list; 515 513 } … … 523 521 // If only 'from' is specified the number of entries are ment 524 522 // 525 const Bool_t exc = from>0 && to==0; 526 527 const UInt_t first = exc ? 0 : from; 528 const UInt_t last = exc ? from : to; 529 530 for (UInt_t num=first; num<last; num++) 531 { 532 if (from!=0 || to!=0) 533 sprintf(auxname+len, ";%d", num+1); 523 if (first==0 && last!=0) 524 first = 1; 525 526 for (UInt_t i=first; i<=last; i++) 527 { 528 if (first!=0 || last!=0) 529 sprintf(auxname+len, ";%d", i); 534 530 535 531 TObject *obj = FindCreateObj(auxname, oname); … … 558 554 // compiled programs if you are not 100% sure what you are doing. 559 555 // 560 TObjArray MParList::CreateObjList(const char *cname, const UInt_t from, const UInt_t to, const char *oname)556 TObjArray MParList::CreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname) 561 557 { 562 558 TObjArray list; 559 560 if (first>0 && last<first) 561 { 562 gLog << dbginf << "Cannot create entries backwards (last<first)...skipped." << endl; 563 return list; 564 } 563 565 564 566 // … … 584 586 // If only 'from' is specified the number of entries are ment 585 587 // 586 const Bool_t exc = from>0 && to==0; 587 588 const UInt_t first = exc ? 0 : from; 589 const UInt_t last = exc ? from : to; 590 591 for (UInt_t num=first; num<last; num++) 592 { 593 if (from!=0 || to!=0) 594 sprintf(auxname+len, ";%d", num+1); 588 if (first==0 && last!=0) 589 first = 1; 590 591 for (UInt_t i=first; i<=last; i++) 592 { 593 if (first!=0 || last!=0) 594 sprintf(auxname+len, ";%d", i); 595 595 596 596 // -
trunk/MagicSoft/Mars/mbase/MParList.h
r959 r984 20 20 #include "MParContainer.h" 21 21 #endif 22 23 #include <TObjArray.h> 22 24 23 25 class MLog; … … 49 51 MParContainer *FindCreateObj(const char *classname, const char *objname=NULL); 50 52 51 TObjArray FindObjectList(const char *name, const UInt_t from, const UInt_t to=0) const; 52 TObjArray FindCreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL); 53 TObjArray FindObjectList(const char *name, UInt_t first, const UInt_t last) const; 54 TObjArray FindObjectList(const char *name, const UInt_t num) const 55 { 56 return FindObjectList(name, 0, num); 57 } 53 58 54 static TObjArray CreateObjList(const char *cname, const UInt_t from, const UInt_t to=0, const char *oname=NULL); 59 TObjArray FindCreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL); 60 TObjArray FindCreateObjList(const char *cname, const UInt_t num, const char *oname=NULL) 61 { 62 return FindCreateObjList(cname, 0, num, oname); 63 } 64 65 static TObjArray CreateObjList(const char *cname, UInt_t first, const UInt_t last, const char *oname=NULL); 66 static TObjArray CreateObjList(const char *cname, const UInt_t num, const char *oname=NULL) 67 { 68 return CreateObjList(cname, 0, num, oname); 69 } 55 70 56 71 void Reset();
Note:
See TracChangeset
for help on using the changeset viewer.