- Timestamp:
- 12/03/07 15:48:13 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGChangeList.cpp
r1014 r1030 64 64 65 65 #if 1 66 void ChangeList::addAddRefd(const UInt32 uiContainerId) 66 void 67 ChangeList::addAddExternalRef(UInt32 const uiContainerId) 67 68 { 68 69 #ifdef OSG_ENABLE_VALGRIND_CHECKS … … 71 72 72 73 #ifndef SILENT 73 fprintf(stderr, "Add AddRef %u\n", 74 uiContainerId); 75 #endif 76 77 ContainerChangeEntry *pEntry = getNewEntry(); 78 79 pEntry->uiEntryDesc = ContainerChangeEntry::AddReference; 80 pEntry->uiContainerId = uiContainerId; 81 } 82 83 void ChangeList::addSubRefd(const UInt32 uiContainerId, 84 bool ignoreLevel ) 85 { 86 #ifdef OSG_ENABLE_VALGRIND_CHECKS 87 VALGRIND_CHECK_VALUE_IS_DEFINED(uiContainerId); 88 #endif 89 90 #ifndef SILENT 91 fprintf(stderr, "Add SubRef %u\n", uiContainerId); 92 #endif 93 94 ContainerChangeEntry *pEntry = getNewEntry(); 95 96 if(_iSubRefLevel == 0 || ignoreLevel == true) 97 { 98 pEntry->uiEntryDesc = ContainerChangeEntry::SubReference; 99 } 100 else 101 { 102 pEntry->uiEntryDesc = ContainerChangeEntry::DepSubReference; 103 } 104 105 pEntry->uiContainerId = uiContainerId; 106 } 107 108 void 109 ChangeList::addAddExternalRefd(UInt32 const uiContainerId) 110 { 111 #ifndef SILENT 112 FDEBUG(("ChangeList::addAddExternalRefd [%u]\n", uiContainerId)); 74 fprintf(stderr, "ChangeList::addAddExternalRef [%u]\n", uiContainerId); 113 75 #endif 114 76 … … 120 82 121 83 void 122 ChangeList::addSubExternalRefd(UInt32 const uiContainerId) 123 { 84 ChangeList::addSubExternalRef(UInt32 const uiContainerId) 85 { 86 #ifdef OSG_ENABLE_VALGRIND_CHECKS 87 VALGRIND_CHECK_VALUE_IS_DEFINED(uiContainerId); 88 #endif 89 124 90 #ifndef SILENT 125 FDEBUG(("ChangeList::addSubExternalRefd [%u]\n", uiContainerId));91 fprintf(stderr, "ChangeList::addSubExternalRef [%u]\n", uiContainerId); 126 92 #endif 127 93 … … 223 189 224 190 returnValue->_uiAspect = Thread::getCurrentAspect(); 225 226 191 returnValue->_bExternal = true; 227 192 … … 242 207 _workStore ( ), 243 208 _uiAspect ( 0), 244 _iSubRefLevel ( 0),245 209 _bExternal (false ) 246 210 { … … 290 254 } 291 255 292 293 294 295 256 ContainerChangeEntry *ChangeList::getNewEntry(void) 296 257 { … … 319 280 if(_workStore.empty() == false) 320 281 { 321 fprintf(stderr, "warning non empty workstore found\n"); 322 } 323 282 FWARNING(("ChangeList::doCommitChanges<>: Non-empty workstore found\n")); 283 } 324 284 325 285 const unsigned loop_detection_limit(15); … … 405 365 { 406 366 #ifndef SILENT_CPTR 407 fprintf(stderr, "Strange handler nil %d %p\n", 408 (*ccIt)->uiContainerId, 409 pHandler); 410 367 fprintf(stderr, "ChangeList::doApply: Handler is NULL %d %p\n", 368 (*ccIt)->uiContainerId, pHandler); 411 369 #endif 412 370 ++ccIt; … … 420 378 { 421 379 #ifndef SILENT_CPTR 422 fprintf(stderr, "Strange src nil %d %p\n", 423 (*ccIt)->uiContainerId, 424 pSrc); 425 380 fprintf(stderr, "ChangeList::doApply: Source is NULL %d %p\n", 381 (*ccIt)->uiContainerId, pSrc); 426 382 #endif 427 383 ++ccIt; … … 434 390 435 391 #ifndef SILENT_CPTR 436 fprintf(stderr, "Setup store for %d %p \n", 437 (*ccIt)->uiContainerId, 438 pDst); 392 fprintf(stderr, "ChangeList::doApply: Setup store for %d %p\n", 393 (*ccIt)->uiContainerId, pDst); 439 394 #endif 440 395 … … 544 499 } 545 500 } 546 else if((*cIt)->uiEntryDesc == ContainerChangeEntry::AddReference) 547 { 548 #ifndef SILENT_CPTR 549 fprintf(stderr, "Execute add Ref for %d %s\n", 550 (*cIt)->uiContainerId, pDst->getType().getCName()); 551 #endif 552 553 if(pDst != NULL) 554 pDst->addReference(); 555 } 556 else if((*cIt)->uiEntryDesc == ContainerChangeEntry::SubReference)// || 557 // (*cIt)->uiEntryDesc == ContainerChangeEntry::DepSubReference) 558 { 559 #ifndef SILENT_CPTR 560 fprintf(stderr, "Execute sub Ref for %d %s\n", 561 (*cIt)->uiContainerId, pDst->getType().getCName()); 562 #endif 563 564 if(pDst != NULL) 565 pDst->subReference(); 566 } 501 // else if((*cIt)->uiEntryDesc == ContainerChangeEntry::AddExternalReference) 502 // { 503 // #ifndef SILENT_CPTR 504 // fprintf(stderr, "Execute add Ref for %d %s\n", 505 // (*cIt)->uiContainerId, pDst->getType().getCName()); 506 // #endif 507 // 508 // if(pDst != NULL) 509 // pDst->addExternalReference(); 510 // } 511 // else if((*cIt)->uiEntryDesc == ContainerChangeEntry::SubExternalReference) 512 // { 513 // #ifndef SILENT_CPTR 514 // fprintf(stderr, "Execute sub Ref for %d %s\n", 515 // (*cIt)->uiContainerId, pDst->getType().getCName()); 516 // #endif 517 // 518 // if(pDst != NULL) 519 // pDst->subExternalReference(); 520 // } 567 521 568 522 ++cIt; … … 576 530 if(_uiAspect != Thread::getCurrentAspect()) 577 531 { 578 fprintf(stderr, "ChangeList::doClear aspects don't match %d %d\n",579 _uiAspect, Thread::getCurrentAspect()) ;532 FWARNING(("ChangeList::doClear: Aspects don't match %d %d\n", 533 _uiAspect, Thread::getCurrentAspect())); 580 534 581 535 return; … … 632 586 while(cIt != cEnd) 633 587 { 634 if((*cIt)->uiEntryDesc == ContainerChangeEntry::AddReference || 635 (*cIt)->uiEntryDesc == ContainerChangeEntry::SubReference || 636 (*cIt)->uiEntryDesc == ContainerChangeEntry::DepSubReference ) 588 if((*cIt)->uiEntryDesc == ContainerChangeEntry::AddExternalReference || 589 (*cIt)->uiEntryDesc == ContainerChangeEntry::SubExternalReference ) 637 590 { 638 591 ContainerChangeEntry *pEntry = getNewEntry(); … … 676 629 this->addCreated(i); 677 630 678 for(UInt32 j = 0; j < pContainer->get RefCount(); ++j)679 this->addAdd Refd(i);680 631 for(UInt32 j = 0; j < pContainer->getExternalRefCount(); ++j) 632 this->addAddExternalRef(i); 633 681 634 ContainerChangeEntry *pEntry = this->getNewEntry(); 682 635
