Пример #1
0
void Ambassador::turnInteractionsOff (
     RTI::InteractionClassHandle theInteraction)
   throw (
     RTI::InteractionClassNotPublished,
     RTI::FederateInternalError)
{
   std::cout << "Ambassador::turnInteractionsOff(): " ;
   NetIO* netIO = getNetIO();
   int idx = netIO->findInteractionClassIndex(theInteraction);
   if (idx != 0) {
      std::cout << idx;
      netIO->setInteractionEnabledFlag(idx,false);
   }
   std::cout << std::endl;
}
Пример #2
0
void Ambassador::turnInteractionsOn (
     RTI::InteractionClassHandle theInteraction)
   throw (
     RTI::InteractionClassNotPublished,
     RTI::FederateInternalError)
{
   std::cout << "Ambassador::turnInteractionsOn(): " ;
   NetIO* netIO = getNetIO();
   int idx = netIO->findInteractionClassIndex(theInteraction);
   if (idx != 0 && netIO->isInteractionClassPublished(idx)) {
      // It's an interaction that we publish, so we can start
      // send new interactions of this class ...
      std::cout << idx;
      netIO->setInteractionEnabledFlag(idx,true);
   }
   std::cout << std::endl;
}
Пример #3
0
void Ambassador::receiveInteraction (
        RTI::InteractionClassHandle       theInteraction,
  const RTI::ParameterHandleValuePairSet& theParameters,
  const char*)
throw (
   RTI::InteractionClassNotKnown,
   RTI::InteractionParameterNotKnown,
   RTI::FederateInternalError)
{
   std::cout << "Ambassador::receiveInteraction(): " << theInteraction << std::endl;
   NetIO* netIO = getNetIO();
   int idx = netIO->findInteractionClassIndex(theInteraction);
   if (idx != 0 && netIO->isInteractionClassSubscribed(idx)) {
      // It's an interaction that we subscribe to, so ...

      // just act as an interface to NetIO, which will handle this.
      getNetIO()->receiveInteraction(theInteraction, theParameters);
   }
}