예제 #1
0
//------------------------------------------------------------------------------
// unregisterAllObjects() --
//------------------------------------------------------------------------------
bool NetIO::unregisterAllObjects()
{
   // Stop Registration For Object Classes
   clearAllObjectClassRegistrationFlags();

   // Unregister all of our output objects ...
   for (unsigned int idx = 0; idx < nOutObjects; idx++) {
      Nib* nib = outHandleTbl[idx];
      if (nib->isRegistered()) {
         getRTIambassador()->deleteObjectInstance(nib->getObjectHandle(),0);
         nib->setObjectHandle(0);
         nib->setClassIndex(0);
      }
   }
   return true;
}
예제 #2
0
void NetIO::destroyOutputNib(Simulation::Nib* const nib0)
{
   std::cout << "NetIO::destroyOutputNib(" << nib0 << ")" << std::endl;
   Nib* nib = dynamic_cast<Nib*>(nib0);
   if (nib != 0) {
      if (nib->isRegistered()) {
         // When this output NIB was registered as an HLA object ...
         std::cout << "###DeleteReq- Unref-2: handle: " << nib->getObjectHandle() << std::endl;
         removeNibFromObjectTables(nib, OUTPUT_NIB);
         getRTIambassador()->deleteObjectInstance(nib->getObjectHandle(),0);
         nib->setObjectHandle(0);
         nib->setClassIndex(0);
      }
      // Let our base class handle the rest
      BaseClass::destroyOutputNib(nib);
   }
}