Exemplo n.º 1
0
void Ambassador::reflectAttributeValues (
        RTI::ObjectHandle                 theObject,
  const RTI::AttributeHandleValuePairSet& theAttrs,
  const char*                             theTag)
throw (
   RTI::ObjectNotKnown,
   RTI::AttributeNotKnown,
   RTI::FederateOwnsAttributes,
   RTI::FederateInternalError)
{
   //std::cout << "Ambassador::reflectAttributeValues(): object = " << theObject << ", theTag=" << theTag << std::endl;
   // find the input object
   NetIO* netIO = getNetIO();
   Nib* nib = static_cast<Nib*>( netIO->findNibByObjectHandle(theObject, NetIO::INPUT_NIB) );
   if (nib != nullptr) nib->reflectAttributeValues(theAttrs);
}
Exemplo n.º 2
0
void Ambassador::provideAttributeValueUpdate (
        RTI::ObjectHandle        theObject,
  const RTI::AttributeHandleSet& theAttrs)
throw (
   RTI::ObjectNotKnown,
   RTI::AttributeNotKnown,
   RTI::AttributeNotOwned,
   RTI::FederateInternalError)
{
   //std::cout << "Ambassador:provideAttributeValueUpdate(): ";
   // Find the output object
   NetIO* netIO = getNetIO();
   Nib* nib = static_cast<Nib*>( netIO->findNibByObjectHandle(theObject, NetIO::OUTPUT_NIB) );

   if (nib != nullptr) nib->provideAttributeValueUpdate(theAttrs);
   //std::cout << std::endl;
}
Exemplo n.º 3
0
void Ambassador::removeObjectInstance (
        RTI::ObjectHandle          theObject,
  const char*                      theTag)
throw (
   RTI::ObjectNotKnown,
   RTI::FederateInternalError)
{
   std::cout << "Ambassador::removeObjectInstance(): remove object = " << theObject << ", theTag=" << theTag << std::endl;

   // find the input object
   NetIO* netIO = getNetIO();
   Nib* nib = netIO->findNibByObjectHandle(theObject, NetIO::INPUT_NIB);
   if (nib != nullptr) {
      // set NIB delete request (Simulation::NetIO::cleanupInputList() should handle this)
      nib->setMode(simulation::Player::DELETE_REQUEST);
   }
}
Exemplo n.º 4
0
//------------------------------------------------------------------------------
// turnUpdatesOffForObjectInstance
//------------------------------------------------------------------------------
void Ambassador::turnUpdatesOffForObjectInstance (
        RTI::ObjectHandle        theObject,
  const RTI::AttributeHandleSet& theAttributes)
throw (
   RTI::ObjectNotKnown,
   RTI::AttributeNotOwned,
   RTI::FederateInternalError)
{
   //std::cout << "Ambassador:turnUpdatesOffForObjectInstance(): ";

   // Find the output object
   NetIO* netIO = getNetIO();
   Nib* nib = static_cast<Nib*>(netIO->findNibByObjectHandle(theObject, NetIO::OUTPUT_NIB));

   if (nib != 0) nib->turnUpdatesOff(theAttributes);
   //std::cout << std::endl;
}