Show
Ignore:
Timestamp:
02/12/08 09:51:59 (9 months ago)
Author:
cneumann
Message:

fixed: - pointer fields: sync/copyFromBin order of inc/dec refcount

(always inc new pointer first, then dec old pointer)

  • cluster server: commented out writing of .osg file on each frame
  • multi display window: merged fix from trunk (r1058)
  • tutorial 12: empty address check

added: - pointer field handles: implemented equal and share

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/Cluster/Base/OSGRemoteAspect.cpp

    r1059 r1060  
    156156            case NEWTYPE: 
    157157            { 
     158                FDEBUG(("RemoteAspect::receiveSync: NEWTYPE")); 
     159             
    158160                connection.getValue(remoteTypeId); 
    159161                connection.getValue(name); 
    160162 
     163                FPDEBUG((" remoteTypeId [%d] name [%s]\n", remoteTypeId, name.c_str())); 
     164                 
    161165                // find local type 
    162166                fcType = FieldContainerFactory::the()->findType(name.c_str()); 
     
    180184            case CREATED: 
    181185            { 
     186                FDEBUG(("RemoteAspect::receiveSync: CREATED")); 
     187             
    182188                connection.getValue(remoteTypeId); 
    183189                connection.getValue(remoteId); 
    184190 
     191                FPDEBUG((" remoteTypeId [%d] remoteId [%d]\n", remoteTypeId, remoteId)); 
     192                 
    185193                localTypeI = _localType.find(remoteTypeId); 
    186194 
     
    206214                         
    207215                        newContainers.push_back(fcPtr); 
    208                              
     216                         
    209217                        // remove this node, when aspect is removed 
    210218                        _receivedFC.insert(getContainerId(fcPtr)); 
     
    228236            case CHANGED: 
    229237            { 
     238                FDEBUG(("RemoteAspect::receiveSync: CHANGED")); 
     239             
    230240                connection.getValue(remoteId); 
    231241                connection.getValue(mask); 
    232242                connection.getValue(len); 
     243                 
     244                FPDEBUG((" [%d]\n", remoteId)); 
    233245                 
    234246                if(getLocalId(remoteId, localId)) 
     
    260272            case SYNCENDED: 
    261273            { 
     274                FDEBUG(("RemoteAspect::receiveSync: SYNCENDED\n")); 
     275             
    262276                finish = true; 
    263277                break; 
     
    266280            case ADDEXTERNALREFED: 
    267281            { 
     282                FDEBUG(("RemoteAspect::receiveSync: ADDEXTERNALREFED")); 
     283             
    268284                connection.getValue(remoteId); 
    269285 
     286                FPDEBUG((" [%d]\n", remoteId)); 
     287                 
    270288                if(getLocalId(remoteId, localId)) 
    271289                { 
     
    288306            case SUBEXTERNALREFED: 
    289307            { 
     308                FDEBUG(("RemoteAspect::receiveSync: SUBEXTERNALREFED")); 
     309             
    290310                connection.getValue(remoteId); 
    291311 
     312                FPDEBUG((" [%d]\n", remoteId)); 
     313                 
    292314                if(getLocalId(remoteId,localId)) 
    293315                { 
     
    310332            case IDMAPPING: 
    311333            { 
     334                FDEBUG(("RemoteAspect::receiveSync: IDMAPPING")); 
     335             
    312336                connection.getValue(remoteId); 
    313337                connection.getValue(localAspect); 
    314338                connection.getValue(localId); 
    315339 
     340                FPDEBUG((" remoteId [%d] localAspect [%d] localId [%d]\n", 
     341                    remoteId, localAspect, localId)); 
     342                 
    316343                if(localAspect != _aspectId) 
    317344                { 
     
    344371        commitChangesAndClear(); 
    345372    } 
    346  
     373     
    347374    // unregister mapper into factory 
    348375    factory->setMapper(NULL); 
     
    387414    handleFCMapping(connection); 
    388415 
     416    FDEBUG(("RemoteAspect:sendSync: Dumping list CL sizes:\n")); 
     417    changeList->dumpListSizes(); 
     418    changeList->dump(); 
     419     
    389420    for(  changedI  = changeList->beginCreated(); 
    390421          changedI != changeList->endCreated  ();  
     
    415446                connection.putValue(typeId); 
    416447                connection.putValue(typeName); 
     448                 
     449                FDEBUG(("RemoteAspect::sendSync: NEWTYPE typeId [%d] typeName [%s]\n", typeId, typeName.c_str())); 
    417450            } 
    418451             
     
    422455            connection.putValue((*changedI)->uiContainerId); 
    423456             
     457            FDEBUG(("RemoteAspect::sendSync: CREATED typeId [%d] containerId [%d]\n", typeId, (*changedI)->uiContainerId));             
    424458#if 0 
    425459            fprintf(stderr, "Send Create %d %d\n", 
     
    440474        ++changedI) 
    441475    { 
    442         fcPtr = fcFactory->getContainer((*changedI)->uiContainerId); 
    443  
    444         if(fcPtr == NullFC) 
    445         { 
    446             continue; 
    447         } 
    448476        if((*changedI)->uiEntryDesc == ContainerChangeEntry::Change) 
    449477        { 
     478            fcPtr = fcFactory->getContainer((*changedI)->uiContainerId); 
     479         
     480            if(fcPtr == NullFC) 
     481                continue;           // skip, if object is destroyed 
    450482         
    451483            mask  = (*changedI)->whichField; 
     
    460492                mask &= TypeTraits<BitVector>::BitsSet ^ filterI->second; 
    461493            } 
    462  
    463494 
    464495#if 0 
     
    485516                fcPtr->copyToBin(connection, mask); 
    486517 
    487                 FDEBUG(("Changed: %s ID:%d Mask:%lld\n",  
     518                FDEBUG(("RemoteAspect::sendSync: CHANGED [%s] ID [%d] Mask [%lld]\n",  
    488519                        fcPtr->getType().getName().str(), 
    489520                        getContainerId(fcPtr),  
     
    493524        else if((*changedI)->uiEntryDesc == ContainerChangeEntry::AddExternalReference) 
    494525        { 
     526            FDEBUG(("RemoteAspect::sendSync: ADDEXTERNALREFED\n")); 
     527         
    495528            UInt32  id = (*changedI)->uiContainerId; 
    496529             
     
    501534            connection.putValue(cmd); 
    502535            connection.putValue(id); 
     536             
     537            FDEBUG(("RemoteAspect::sendSync: transmitted ADDEXTERNALREFED id [%d]\n", id)); 
    503538        }    
    504539        else if((*changedI)->uiEntryDesc == ContainerChangeEntry::SubExternalReference) 
    505540        { 
     541            FDEBUG(("RemoteAspect::sendSync: SUBEXTERNALREFED\n")); 
     542         
    506543            UInt32  id = (*changedI)->uiContainerId; 
    507544             
     
    513550            connection.putValue(cmd); 
    514551            connection.putValue(id); 
     552             
     553            FDEBUG(("RemoteAspect::sendSync: transmitted SUBEXTERNALREFED id [%d]\n", id)); 
    515554        } 
    516555    } 
     
    615654 */ 
    616655 
    617 bool RemoteAspect::callCreated(const FieldContainerPtr &fcp) 
     656bool RemoteAspect::callCreated(FieldContainerPtrConst fcp) 
    618657{ 
    619658    bool    result; 
     
    637676 */ 
    638677 
    639 bool RemoteAspect::callDestroyed(const FieldContainerPtr &fcp) 
     678bool RemoteAspect::callDestroyed(FieldContainerPtrConst fcp) 
    640679{ 
    641680    bool    result; 
     
    659698 */ 
    660699 
    661 bool RemoteAspect::callChanged(const FieldContainerPtr &fcp) 
     700bool RemoteAspect::callChanged(FieldContainerPtrConst fcp) 
    662701{ 
    663702    bool    result;