Changeset 135 for trunk/src/core
- Timestamp:
- Nov 10, 2005, 7:45:00 PM (19 years ago)
- Location:
- trunk/src/core
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/RpBindingsDict.cc
r122 r135 25 25 * function's caller. 26 26 * 27 * Returns the key of the object in the dictionary 27 * Returns the key of the object in the dictionary 28 * On Error, returns 0 (which also means nothing can be stored at 0) 28 29 */ 29 30 30 31 int 31 storeObject_Lib(RpLibrary* objectName ) {32 33 int retVal = -1;34 int dictKey = ObjDict_Lib.size() + 1;32 storeObject_Lib(RpLibrary* objectName, int key) { 33 34 int retVal = 0; 35 int dictKey = key; 35 36 int newEntry = 0; 36 37 … … 39 40 // no error checking to make sure it was successful in entering 40 41 // the new entry. 42 43 if (dictKey == 0) { 44 dictKey = ObjDict_Lib.size() + 1; 45 } 41 46 ObjDict_Lib.set(dictKey,objectName, &newEntry); 42 }43 44 retVal = dictKey; 47 retVal = dictKey; 48 } 49 45 50 return retVal; 46 51 } … … 61 66 getObject_Lib(int objKey) { 62 67 63 RpLibrary* retVal = *(ObjDict_Lib.find(objKey).getValue()); 68 69 RpLibrary* retVal = NULL; 70 71 retVal = *(ObjDict_Lib.find(objKey).getValue()); 64 72 65 73 if (retVal == *(ObjDict_Lib.getNullEntry().getValue())) { -
trunk/src/core/RpLibrary.cc
r125 r135 478 478 // METHOD: children() 479 479 /// Return the next child of the node located at 'path' 480 // 481 // The lookup is reset when you send a NULL rpChilNode. 482 // 480 483 /** 481 484 */ … … 503 506 // in the last call to this function. 504 507 // if so, then we dont need to reset the parentNode 505 if ( path.compare(old_path) == 0 ) { 508 // 509 // this check is probably more dependent on rpChildNode 510 // because we want to see if the person want to continue 511 // an old search or start from the beginning of the child list 512 // 513 if ( (path.compare(old_path) == 0) && (rpChildNode != NULL) ) { 506 514 parentNode = NULL; 507 515 } … … 526 534 if (parentNode) { 527 535 myChildCount = scew_element_count(parentNode); 528 std::cout << "myChildCount = " << myChildCount << std::endl;529 536 } 530 537 … … 537 544 if (!type.empty()) { 538 545 childName = scew_element_name(childNode); 546 // we are searching for a specific child name 547 // keep looking till we find a name that matches the type. 548 while (type != childName) { 549 childNode = scew_element_next(parentNode,childNode); 550 childName = scew_element_name(childNode); 551 } 539 552 if (type == childName) { 553 // found a child with a name that matches type 540 554 // clean up old memory 541 if (retLib) { 542 delete retLib; 543 } 555 delete retLib; 544 556 retLib = new RpLibrary( childNode ); 557 } 558 else { 559 // no children with names that match 'type' were found 560 delete retLib; 561 retLib = NULL; 545 562 } 546 563 } 547 564 else { 548 565 // clean up old memory 549 if (retLib) { 550 delete retLib; 551 } 566 delete retLib; 552 567 retLib = new RpLibrary( childNode ); 553 568 } … … 557 572 // its probable there are no more child elements left to report 558 573 // clean up old memory 559 if (retLib) { 560 delete retLib; 561 } 574 delete retLib; 562 575 retLib = NULL; 563 576 } -
trunk/src/core/RpNumber.cc
r121 r135 229 229 } 230 230 231 /**********************************************************************/ 232 // METHOD: put() 233 /// Store the information of this Rappture Object into the xml 234 /** 235 */ 236 // 237 //RpNumber& 238 //RpNumber::put() const { 239 // 240 // 241 // return *this; 242 //} 243 231 244 232 245 // -------------------------------------------------------------------- //
Note: See TracChangeset
for help on using the changeset viewer.