#if DtHLA
myNum(0),
myVec()
{
}
{
}
{
}
{
if (this == &orig)
{
return *this;
}
return *this;
}
{
return "TestSimpleInteraction";
}
{
}
#if DtHLA_1516
const RTI::ParameterHandleValueMap& TestSimpleInteraction::phvm() const
#else
#endif
{
#if DtHLA_1516
static RTI::ParameterHandleValueMap thePvMap;
thePvMap.clear();
if (!exerciseConn())
{
DtInfo <<
"Illegal call to TestSimpleInteraction::phvps.\n"
<< "Must call setExConn first." << std::endl;
return thePvMap;
}
RTI::ParameterHandle numberHandle =
exerciseConn()->rtiAmb()->getParameterHandle(
interactionClassHandle(), L"Number");
RTI::ParameterHandle vectorHandle =
exerciseConn()->rtiAmb()->getParameterHandle(
interactionClassHandle(), L"Vector");
thePvMap[numberHandle].setData((char *) &netNum, sizeof(netNum));
thePvMap[vectorHandle].setData((char *) &netVec, sizeof(netVec));
return thePvMap;
#else
static RTI::ParameterHandleValuePairSet* thePvSet = NULL;
if (!thePvSet)
{
thePvSet = RTI::ParameterSetFactory::create(numParameters());
}
thePvSet->empty();
if (!exerciseConn())
{
DtInfo <<
"Illegal call to TestSimpleInteraction::phvps.\n"
<< "Must call setExConn first." << std::endl;
return *thePvSet;
}
RTI::ParameterHandle numberHandle =
exerciseConn()->rtiAmb()->getParameterHandle("Number",
interactionClassHandle());
RTI::ParameterHandle vectorHandle =
exerciseConn()->rtiAmb()->getParameterHandle("Vector",
interactionClassHandle());
thePvSet->add(numberHandle, (char*) &netNum, sizeof(netNum));
thePvSet->add(vectorHandle, (char*) &netVec, sizeof(netVec));
return *thePvSet;
#endif
}
#if DtHLA_1516
void TestSimpleInteraction::setFromPhvm(
const RTI::ParameterHandleValueMap& pvMap)
#else
const RTI::ParameterHandleValuePairSet& pvSet)
#endif
{
if (!exerciseConn())
{
DtInfo <<
"Illegal call to TestSimpleInteraction::setFromPhvps.\n"
<< "Must call setExConn first." << std::endl;
return;
}
#if DtHLA_1516
RTI::ParameterHandle numberHandle =
exerciseConn()->rtiAmb()->getParameterHandle(
interactionClassHandle(), L"Number");
RTI::ParameterHandle vectorHandle =
exerciseConn()->rtiAmb()->getParameterHandle(
interactionClassHandle(), L"Vector");
RTI::ParameterHandleValueMap::const_iterator pos = pvMap.find(numberHandle);
if (pos != pvMap.end())
{
setNumber((int)*netNum);
}
pos = pvMap.find(vectorHandle);
if (pos != pvMap.end())
{
}
#else
RTI::ParameterHandle numberHandle =
exerciseConn()->rtiAmb()->getParameterHandle("Number",
interactionClassHandle());
RTI::ParameterHandle vectorHandle =
exerciseConn()->rtiAmb()->getParameterHandle("Vector",
interactionClassHandle());
RTI::ULong index = 0;
for (index = 0; index < pvSet.size(); index++)
{
RTI::ParameterHandle currentHandle = pvSet.getHandle(index);
if (currentHandle == numberHandle)
{
RTI::ULong length = 0;
pvSet.getValue(index, (char*) &netNum, length);
setNumber((int)netNum);
}
else if (currentHandle == vectorHandle)
{
RTI::ULong length = 0;
pvSet.getValue(index, (char*) &netVec, length);
}
}
#endif
}
{
}
{
}
{
}
{
}
{
}
{
#if DtHLA_1516
#else
#endif
}
{
}
{
return "Test";
}
#endif