- Timestamp:
- 12/03/07 15:48:13 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/Cluster/Base/OSGRemoteAspect.cpp
r835 r1030 101 101 RemoteAspect::~RemoteAspect(void) 102 102 { 103 FieldContainerFactoryBase *pFactory = FieldContainerFactory::the();104 IdSetT::iterator i;105 106 FieldContainerPtr fcPtr;107 108 // subRef received field container109 for(i = _receivedFC.begin(); i != _receivedFC.end(); i++)110 {111 fcPtr = pFactory->getContainer(*i);112 113 if(fcPtr != NullFC)114 {115 callDestroyed(fcPtr);116 117 do118 {119 120 fcPtr->subReferenceUnresolved();121 fcPtr = pFactory->getContainer(*i);122 123 } while(fcPtr != NullFC);124 }125 }126 103 } 127 104 … … 129 106 /* Remote aspect functionaliy */ 130 107 131 /*! <EM>receiveSync</EM>reads changes from the given connection and108 /*! \e receiveSync reads changes from the given connection and 132 109 * applies them to the current thread aspect. 133 * Functors for registered types are called, if they occur ein the110 * Functors for registered types are called, if they occur in the 134 111 * sync stream. 135 112 * … … 209 186 if(localTypeI == _localType.end()) 210 187 { 211 SWARNING << " Unknown TypeID: "188 SWARNING << "RemoteAspect::receiveSync: Unknown TypeID: " 212 189 << remoteTypeId 213 190 << " for remote id " … … 238 215 else 239 216 { 240 FDEBUG(("FC already created %d\n",remoteId)); 217 FWARNING(("RemoteAspect::receiveSync: FC already " 218 "created %d\n",remoteId)); 241 219 } 242 220 } … … 250 228 connection.getValue(len); 251 229 252 if(getLocalId(remoteId, localId))230 if(getLocalId(remoteId, localId)) 253 231 { 254 232 fcPtr = factory->getContainer(localId); … … 257 235 258 236 callChanged(fcPtr); 259 260 237 } 261 238 else … … 263 240 char dummy; 264 241 265 SWARNING << "Can't change unknown FC:" 242 SWARNING << "RemoteAspect::receiveSync: " 243 << "Can't change unknown FC: " 266 244 << remoteId 267 << " skip "245 << " skiping " 268 246 << len 269 247 << " bytes." … … 282 260 } 283 261 284 case ADD REFED:262 case ADDEXTERNALREFED: 285 263 { 286 264 connection.getValue(remoteId); … … 290 268 fcPtr = factory->getContainer(localId); 291 269 292 FDEBUG((" AddRef: %s ID:%d\n",270 FDEBUG(("RemoteAspect::receiveSync: AddExternalRef: %s ID:%d\n", 293 271 fcPtr->getType().getName().str(), 294 272 getContainerId(fcPtr))); 295 273 296 addRef(fcPtr);274 fcPtr->addExternalReference(); 297 275 } 298 276 else 299 277 { 300 FDEBUG(("Can't addref unknown FC:%d\n", remoteId)); 278 FWARNING(("RemoteAspect::receiveSync: Can't addref unknown " 279 "FC:%d\n", remoteId)); 301 280 } 302 281 break; 303 282 } 304 283 305 case SUB REFED:284 case SUBEXTERNALREFED: 306 285 { 307 286 connection.getValue(remoteId); … … 311 290 fcPtr = factory->getContainer(localId); 312 291 313 FDEBUG((" SubRef: %s ID:%d\n",292 FDEBUG(("RemoteAspect::receiveSync: SubExternalRef: %s ID:%d\n", 314 293 fcPtr->getType().getName().str(), 315 294 getContainerId(fcPtr))); 316 295 317 subRef(fcPtr);296 fcPtr->subExternalReference(); 318 297 } 319 298 else 320 299 { 321 FDEBUG(("Can't subref unknown FC:%d\n", remoteId)); 300 FWARNING(("RemoteAspect::receiveSync: Can't subref unknown " 301 "FC:%d\n", remoteId)); 322 302 } 323 303 break; … … 332 312 if(localAspect != _aspectId) 333 313 { 334 SFATAL << "ID mapping for wrong aspect" << std::endl; 314 SFATAL << "RemoteAspect::receiveSync: " 315 << "ID mapping for wrong aspect" << endLog; 335 316 } 336 317 … … 344 325 default: 345 326 { 346 SFATAL << "Unknown tag:" << (int) cmd << std::endl;327 SFATAL << "Unknown tag:" << (int) cmd << endLog; 347 328 throw RemoteSyncError(); 348 329 } … … 373 354 * of local states. e.g. GL variables. 374 355 */ 375 376 356 void RemoteAspect::sendSync(Connection &connection, ChangeList *changeList) 377 357 { … … 507 487 } 508 488 } 509 else if((*changedI)->uiEntryDesc == ContainerChangeEntry::Add Reference)489 else if((*changedI)->uiEntryDesc == ContainerChangeEntry::AddExternalReference) 510 490 { 511 491 UInt32 id = (*changedI)->uiContainerId; … … 514 494 continue; 515 495 516 cmd = ADD REFED;496 cmd = ADDEXTERNALREFED; 517 497 connection.putValue(cmd); 518 498 connection.putValue(id); 519 499 } 520 else if((*changedI)->uiEntryDesc == ContainerChangeEntry::Sub Reference)500 else if((*changedI)->uiEntryDesc == ContainerChangeEntry::SubExternalReference) 521 501 { 522 502 UInt32 id = (*changedI)->uiContainerId; 523 503 524 // ignore addrefs for unknown fcs525 if(_mappedFC.count(id) ==0)504 // ignore subrefs for unknown fcs 505 if(_mappedFC.count(id) == 0) 526 506 continue; 527 507 528 cmd = SUB REFED;508 cmd = SUBEXTERNALREFED; 529 509 connection.putValue(cmd); 530 510 connection.putValue(id); … … 707 687 ++remoteFCI) 708 688 { 709 remoteId = (UInt32)(remoteFCI->second );710 remoteAspect = (UInt32)(remoteFCI->second >>32);689 remoteId = (UInt32)(remoteFCI->second ); 690 remoteAspect = (UInt32)(remoteFCI->second >> 32); 711 691 712 692 cmd = IDMAPPING; … … 726 706 */ 727 707 728 void RemoteAspect::clearFCMapping(UInt32 localId, UInt32 remoteId)708 void RemoteAspect::clearFCMapping(UInt32 localId, UInt32 remoteId) 729 709 { 730 710 _mappedFC.erase(localId); … … 763 743 if( localFCI != _localFC.end() ) 764 744 { 765 localId =localFCI->second;745 localId = localFCI->second; 766 746 return true; 767 747 }
