rtiSimple1516e.cxx and rtiSimpleFedAmb1516e.cxx (rtiSimpleFedAmb1516e.h) have the RTI calls and federate ambassador calls for the HLA Evolved version of rtisimple.
This page has the code for the following files:
rtiSimple1516e.cxx
#pragma warning(disable: 4251)
#pragma warning(disable: 4786)
#pragma warning(disable: 4290)
#ifdef WIN32
#include <winsock2.h>
#include <process.h>
#else
#include <unistd.h>
#endif
#include <stdio.h>
#include <wchar.h>
#include <sstream>
#include <string>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdlib>
using namespace rti1516e;
using namespace std;
FederateHandle theFederateHandle;
std::wstring theClassName = L"BaseEntity";
std::wstring theInterClassName = L"WeaponFire";
ObjectClassHandle theClassHandle;
InteractionClassHandle theInterClassHandle;
ObjectInstanceHandle theObjectHandle;
{
wcout << L"Connect to RTI" << endl;
try
{
rtiAmb.connect(fedAmb, HLA_EVOKED, localDesignator);
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl;
return false;
}
wcout << L"Connected." << endl;
return true;
}
{
try
{
int count = 0;
theAmbData.listFederationsReturned = false;
rtiAmb.listFederationExecutions();
wcout << L"Waiting for reportFederationExecutions\n";
while (count < 100 && !theAmbData.listFederationsReturned)
{
count++;
}
if (!theAmbData.listFederationsReturned)
{
wcout << L"\nFailed to get reportFederationExecutions callback\n";
}
}
catch (RTIinternalError& ex)
{
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not list federation executions!" << endl;
}
}
void createFedEx(
RTIambassador& rtiAmb, std::wstring
const& fedName, std::wstring
const& fedFile)
{
wcout << L"createFederationExecution " << fedName << L" " << fedFile << endl;
try
{
}
catch (FederationExecutionAlreadyExists& ex)
{
wcout << L"FederationExecutionAlreadyExists: " << ex.what() << endl
<< L"\tCould not create federation execution!" << endl;
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not create federation execution!" << endl;
exit(0);
}
wcout << L"Federation Created." << endl;
}
void joinFedEx(
RTIambassador& rtiAmb, std::wstring
const& federateType, std::wstring
const& federationName)
{
bool joined = false;
const int maxTry = 10;
int numTries = 0;
wcout << L"joinFederationExecution " << federateType << L" " << federationName << endl;
while (!joined && numTries++ < maxTry)
{
try
{
joined = true;
}
catch (FederationExecutionDoesNotExist)
{
wcout << L"FederationExecutionDoesNotExist, try " << numTries << L" out of " << maxTry << endl;
continue;
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl;
return;
}
}
if (joined)
{
wcout << L"Joined Federation." << endl;
}
else
{
wcout << L"Giving up." << endl;
exit(0);
}
}
void resignAndDestroy(
RTIambassador& rtiAmb, std::wstring
const& federationName)
{
wcout << L"Resign and Destroy Federation" << endl;
rtiAmb.disconnect();
}
{
try
{
theAmbData.objectClassMap[theClassHandle] = theClassName;
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not get object class handle: " << theClassName << endl;
return false;
}
std::wstring attrName;
try
{
attrName = L"AccelerationVector";
hSet.insert(theAttrNameHandleMap[attrName]);
attrName = L"VelocityVector";
hSet.insert(theAttrNameHandleMap[attrName]);
attrName = L"Orientation";
hSet.insert(theAttrNameHandleMap[attrName]);
attrName = L"DeadReckoningAlgorithm";
hSet.insert(theAttrNameHandleMap[attrName]);
attrName = L"WorldLocation";
hSet.insert(theAttrNameHandleMap[attrName]);
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not get attribute handle " << attrName << endl;
return false;
}
int cnt = 0;
try
{
cnt = 1;
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not " << (cnt ? L"subscribe" : L"publish") << endl;
return false;
}
std::wstring objectName(L"Talk");
try
{
unsigned int objId = abs(getpid());
std::wstringstream pid;
pid << objId;
objectName += pid.str();
theAmbData.nameReservationReturned =
theAmbData.nameReservationSucceeded = false;
try
{
}
catch (RTIinternalError& ex)
{
theAmbData.nameReservationReturned =
theAmbData.nameReservationSucceeded = true;
}
wcout << L"Waiting for objectInstanceNameReservationSucceeded\n";
int count = 0;
while (count++ < 100 && !theAmbData.nameReservationReturned)
{
}
if (theAmbData.nameReservationSucceeded)
{
}
else if (theAmbData.nameReservationReturned)
{
wcout << L"Object name reservation failed for " << objectName << endl;
return false;
}
else
{
wcout << L"Failed waiting for reserve object name " << objectName << endl;
return false;
}
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not Register Object " << objectName << L" with class " << theClassName << endl;
return false;
}
wcout << L"Registered object " << objectName << L" with class name " << theClassName << endl;
return true;
}
{
try
{
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not get interaction class handle: " << theInterClassName << endl;
return false;
}
std::wstring paramName;
try
{
paramName = L"EventIdentifier";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"FireControlSolutionRange";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"FireMissionIndex";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"FiringLocation";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"FiringObjectIdentifier";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"FuseType";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"InitialVelocityVector";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"MunitionObjectIdentifier";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"MunitionType";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"QuantityFired";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"RateOfFire";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"TargetObjectIdentifier";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
paramName = L"WarheadType";
theParamNameHandleMap[paramName] = rtiAmb.
getParameterHandle(theInterClassHandle, paramName);
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not get parameter handle " << paramName << endl;
return false;
}
int cnt = 0;
try
{
cnt = 1;
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl
<< L"\tCould not " << (cnt ? L"publish" : L"subscribe") << L" to interaction class." << endl;
return false;
}
wcout << L"Subscribed to interaction class: " << theInterClassName << L" with handle: "
<< theInterClassHandle.toString() << endl;
return true;
}
int main(int argc, char** argv)
{
std::cout << "MAK rtiSimple version 1516e" << std::endl;
try
{
std::wstring federationName(L"MAKsimple");
std::wstring federationFile(L"MAKsimple1516e.xml");
std::wstring federateType(L"rtisimple1516e");
std::wstring localSettingsDesignator;
if (argc > 1)
{
if (strcmp(argv[1], "-h") == 0)
{
wcout << L"Usage: rtisimple1516e [federationName] [federationFile] [federateType]" << endl;
wcout << L"default values: "
<< L"\"" << federationName << L"\" "
<< L"\"" << federationFile << L"\" "
<< L"\"" << federateType << L"\" " << endl;
return 0;
}
}
if (argc > 2)
{
}
if (argc > 3)
{
}
if (argc > 4)
{
for (int argIndex = 4; argIndex < argc; ++argIndex)
{
localSettingsDesignator += L" ";
localSettingsDesignator +=
DtToWString(argv[argIndex]);
}
}
wcout << L"Using " << rtiName() << L" " << rtiVersion() << L"\n";
theAmbData.clear();
std::auto_ptr<RTIambassador> rtiAmbAP = rtiAmbFactory->createRTIambassador();
rtiAmb = rtiAmbAP.release();
#ifdef WIN32
WSADATA data;
WSAStartup(MAKEWORD(1, 1), &data);
#endif
long count = 0;
bool doConnect = true;
bool connected = false;
while (1)
{
if (doConnect)
{
doConnect = false;
if (!connect(*rtiAmb, fedAmb, localSettingsDesignator))
{
wcout << L"Connect to RTI failed!" << endl;
continue;
}
listFederations(*rtiAmb);
createFedEx(*rtiAmb, federationName, federationFile);
joinFedEx(*rtiAmb, federateType, federationName);
if (!publishSubscribeAndRegisterObject(*rtiAmb))
{
resignAndDestroy(*rtiAmb, federationName);
if (rtiAmb != 0)
{
delete rtiAmb;
rtiAmb = 0;
}
return 0;
}
if (!publishAndSubscribeInteraction(*rtiAmb))
{
resignAndDestroy(*rtiAmb, federationName);
if (rtiAmb != 0)
{
delete rtiAmb;
rtiAmb = 0;
}
return 0;
}
attrValues.clear();
DtAttrNameHandleMap::iterator attrIter = theAttrNameHandleMap.begin();
DtAttrNameHandleMap::iterator attrEnd = theAttrNameHandleMap.end();
for (; attrIter != attrEnd; attrIter++)
{
attrValues[attrIter->second].setData(temp.c_str(), temp.length() + 1);
}
paramValues.clear();
DtParamNameHandleMap::iterator paramIter = theParamNameHandleMap.begin();
DtParamNameHandleMap::iterator paramEnd = theParamNameHandleMap.end();
for ( ; paramIter != paramEnd; paramIter++)
{
paramValues[paramIter->second].setData(temp.c_str(), temp.length() + 1);
}
connected = true;
}
else if (connected)
{
std::stringstream ss;
ss << "1516-" << count++;
std::string tag(ss.str());
if (count % 5 == 0)
{
wcout << L"Sending interaction..." << endl;
}
}
int key = theInput.keybrdTick();
if (key < 0)
{
break;
}
else if ('c' == key || 'C' == key)
{
doConnect = !connected;
}
else if ('d' == key || 'D' == key)
{
if (connected)
{
try
{
resignAndDestroy(*rtiAmb, federationName);
connected = false;
}
{
wcout << L
"RTI Exception: " << ex.
what() << endl;
}
}
}
#ifdef WIN32
Sleep(2000);
#else
sleep(2);
#endif
}
if (connected)
{
resignAndDestroy(*rtiAmb, federationName);
}
}
{
wcout << L
"RTI Exception (main loop): " << ex.
what() << endl;
}
if (rtiAmb != 0)
{
delete rtiAmb;
rtiAmb = 0;
}
#ifdef WIN32
WSACleanup();
#endif
return 0;
}
rtiSimpleFedAmb1516e.cxx
#pragma warning(disable: 4251)
#pragma warning(disable: 4786)
#pragma warning(disable: 4290)
#include <iostream>
using namespace std;
using namespace rti1516e;
{
AttributeHandleValueMap::const_iterator iter;
for (iter = attrVals.begin(); iter != attrVals.end(); iter++)
{
wcout << L
"\t" << iter->first.toString() << L
" " <<
DtToWString((
char*)iter->second.data()) << endl;
}
}
{
ParameterHandleValueMap::const_iterator iter;
for (iter = paramVals.begin(); iter != paramVals.end(); iter++)
{
wcout << L
"\t" << iter->first.toString() << L
" " <<
DtToWString((
char*)iter->second.data()) << endl;
}
}
: NullFederateAmbassador(), myData(data)
{
}
throw ()
{
}
std::wstring const& faultDescription)
throw (FederateInternalError)
{
wcout << L"\nconnectionLost: " << faultDescription << std::endl;
myData.connectionLost = true;
}
FederationExecutionInformationVector const& theFederationExecutionInformationList)
throw (FederateInternalError)
{
myData.listFederationsReturned = true;
wcout << L"\nreportFederationExecutions \n";
FederationExecutionInformationVector::const_iterator fedIter = theFederationExecutionInformationList.begin();
FederationExecutionInformationVector::const_iterator fedEnd = theFederationExecutionInformationList.end();
for (; fedIter != fedEnd; ++fedIter)
{
wcout << fedIter->federationExecutionName << L" " << fedIter->logicalTimeImplementationName
<< std::endl;
}
}
std::wstring const& theObjectInstanceName)
throw (FederateInternalError)
{
wcout << L"\nobjectInstanceNameReservationSucceeded: " << theObjectInstanceName << endl;
myData.nameReservationReturned =
myData.nameReservationSucceeded = true;
}
std::wstring const& theObjectInstanceName)
throw (FederateInternalError)
{
wcout << L"\nobjectInstanceNameReservationFailed: " << theObjectInstanceName << endl;
myData.nameReservationReturned = true;
myData.nameReservationSucceeded = false;
}
ObjectInstanceHandle theObject,
ObjectClassHandle theObjectClass,
std::wstring const& theObjectInstanceName)
throw (FederateInternalError)
{
wcout << L"\ndiscoverObjectInstance: "
<< theObjectInstanceName << L"("
<< theObject.toString() << L") of class "
<< myData.objectClassMap[theObjectClass] << L"( "
<< theObjectClass.toString() << L")" << endl;
myData.objectInstanceMap[theObject] = theObjectInstanceName;
}
ObjectInstanceHandle theObject,
ObjectClassHandle theObjectClass,
std::wstring const& theObjectInstanceName,
FederateHandle producingFederate)
throw (FederateInternalError)
{
wcout << L"\ndiscoverObjectInstance: "
<< theObjectInstanceName << L"("
<< theObject.toString() << L") of class "
<< myData.objectClassMap[theObjectClass] << L"( "
<< theObjectClass.toString() << L")"
<< L" produced by " << producingFederate.toString()
<< endl;
myData.objectInstanceMap[theObject] = theObjectInstanceName;
}
ObjectInstanceHandle theObject,
SupplementalReflectInfo theReflectInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nreflectAttributeValues: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< (theReflectInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theReflectInfo.hasProducingFederate ? theReflectInfo.producingFederate.toString() : L"")
<< L"#regions: " << (theReflectInfo.hasSentRegions ? theReflectInfo.sentRegions.size() : 0)
<< L" #attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
ObjectInstanceHandle theObject,
SupplementalReflectInfo theReflectInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nreflectAttributeValues: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< theTime.toString() << L" "
<< (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theReflectInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theReflectInfo.hasProducingFederate ? theReflectInfo.producingFederate.toString() : L"")
<< L"#regions: " << (theReflectInfo.hasSentRegions ? theReflectInfo.sentRegions.size() : 0)
<< L" #attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
ObjectInstanceHandle theObject,
MessageRetractionHandle theHandle,
SupplementalReflectInfo theReflectInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nreflectAttributeValues: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< theTime.toString() << L" "
<< (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theHandle.toString() << L" "
<< (theReflectInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theReflectInfo.hasProducingFederate ? theReflectInfo.producingFederate.toString() : L"")
<< L"#regions: " << (theReflectInfo.hasSentRegions ? theReflectInfo.sentRegions.size() : 0)
<< L" #attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
InteractionClassHandle theInteraction,
SupplementalReceiveInfo theReceiveInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nreceiveInteraction: "
<< theInteraction.toString() << L" "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< (theReceiveInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theReceiveInfo.hasProducingFederate ? theReceiveInfo.producingFederate.toString() : L"")
<< L"#regions: " << (theReceiveInfo.hasSentRegions ? theReceiveInfo.sentRegions.size() : 0)
<< L" #parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
InteractionClassHandle theInteraction,
SupplementalReceiveInfo theReceiveInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nreceiveInteraction: "
<< theInteraction.toString() << L" "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< theTime.toString() << L" "
<< (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theReceiveInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theReceiveInfo.hasProducingFederate ? theReceiveInfo.producingFederate.toString() : L"")
<< L"#regions: " << (theReceiveInfo.hasSentRegions ? theReceiveInfo.sentRegions.size() : 0)
<< L" #parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
InteractionClassHandle theInteraction,
MessageRetractionHandle theHandle,
SupplementalReceiveInfo theReceiveInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nreceiveInteraction: "
<< theInteraction.toString() << L" "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< theTime.toString() << L" "
<< (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theHandle.toString() << L" "
<< (theReceiveInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theReceiveInfo.hasProducingFederate ? theReceiveInfo.producingFederate.toString() : L"")
<< L"#regions: " << (theReceiveInfo.hasSentRegions ? theReceiveInfo.sentRegions.size() : 0)
<< L" #parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
ObjectInstanceHandle theObject,
SupplementalRemoveInfo theRemoveInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nremoveObjectInstance: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theRemoveInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theRemoveInfo.hasProducingFederate ? theRemoveInfo.producingFederate.toString() : L"")
<< endl;
}
ObjectInstanceHandle theObject,
SupplementalRemoveInfo theRemoveInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nremoveObjectInstance: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theTime.toString() << L" "
<< (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theRemoveInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theRemoveInfo.hasProducingFederate ? theRemoveInfo.producingFederate.toString() : L"")
<< endl;
}
ObjectInstanceHandle theObject,
MessageRetractionHandle theHandle,
SupplementalRemoveInfo theRemoveInfo)
throw (FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"\nremoveObjectInstance: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theTime.toString() << L
" " << (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theHandle.toString()
<< (theRemoveInfo.hasProducingFederate ? L"produced by " : L" ")
<< (theRemoveInfo.hasProducingFederate ? theRemoveInfo.producingFederate.toString() : L"")
<< endl;
}
rtiSimpleKeyboard.cxx
#ifdef WIN32
#include <conio.h>
#else
#include <unistd.h>
#endif
{
#ifndef WIN32
tcgetattr(0,&initial_settings);
#endif
}
{
#ifndef WIN32
tcsetattr(0, TCSANOW, &initial_settings);
#endif
}
{
#ifdef WIN32
return _kbhit();
#else
unsigned char ch;
int nread;
nread = read(0,&ch,1);
if (nread == 1)
{
return 1;
}
return 0;
#endif
}
{
char ch;
#ifdef WIN32
ch = _getch();
#else
{
}
else
read(0,&ch,1);
#endif
return ch;
}
{
char key = ' ';
return 0;
while (key !=
'q' && key !=
'Q' &&
kbhit())
return (key == 'q' || key == 'Q') ? -1 : key;
}
rtiSimpleFedAmb1516e.h
#pragma once
#pragma warning(disable: 4251)
#pragma warning(disable: 4786)
#pragma warning(disable: 4290)
#include <string>
#include <map>
{
public:
{
}
{
}
};
{
public:
std::wstring const& faultDescription)
throw (rti1516e::FederateInternalError);
rti1516e::FederationExecutionInformationVector const& theFederationExecutionInformationList)
throw (rti1516e::FederateInternalError);
std::wstring const& theObjectInstanceName)
throw (rti1516e::FederateInternalError);
std::wstring const& theObjectInstanceName)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::ObjectClassHandle theObjectClass,
std::wstring const& theObjectInstanceName)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::ObjectClassHandle theObjectClass,
std::wstring const& theObjectInstanceName,
rti1516e::FederateHandle producingFederate)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::SupplementalReflectInfo theReflectInfo)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::LogicalTime const& theTime,
rti1516e::SupplementalReflectInfo theReflectInfo)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::LogicalTime const& theTime,
rti1516e::MessageRetractionHandle theHandle,
rti1516e::SupplementalReflectInfo theReflectInfo)
throw (rti1516e::FederateInternalError);
rti1516e::InteractionClassHandle theInteraction,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::SupplementalReceiveInfo theReceiveInfo)
throw (rti1516e::FederateInternalError);
rti1516e::InteractionClassHandle theInteraction,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::LogicalTime const& theTime,
rti1516e::SupplementalReceiveInfo theReceiveInfo)
throw (rti1516e::FederateInternalError);
rti1516e::InteractionClassHandle theInteraction,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::LogicalTime const& theTime,
rti1516e::MessageRetractionHandle theHandle,
rti1516e::SupplementalReceiveInfo theReceiveInfo)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::SupplementalRemoveInfo theRemoveInfo)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::LogicalTime const& theTime,
rti1516e::SupplementalRemoveInfo theRemoveInfo)
throw (rti1516e::FederateInternalError);
rti1516e::ObjectInstanceHandle theObject,
rti1516e::VariableLengthData const& theUserSuppliedTag,
rti1516e::LogicalTime const& theTime,
rti1516e::MessageRetractionHandle theHandle,
rti1516e::SupplementalRemoveInfo theRemoveInfo)
throw (rti1516e::FederateInternalError);
public:
};
rtiSimpleKeyboard.h
#ifndef MYKBHIT_H_
#define MYKBHIT_H_
#ifndef WIN32
#include <termios.h>
#endif
{
public:
protected:
private:
#ifndef WIN32
#endif
};
#endif
rtiSimpleStringUtil.h
#ifndef stringUtil_H_
#define stringUtil_H_
#include <string>
#include <sstream>
{
std::wstring temp;
while (*in_val != '\0')
temp += *in_val++;
return temp;
}
inline std::string
DtToString(
const std::wstring &in_val)
{
std::string temp;
std::wstring::const_iterator b = in_val.begin();
const std::wstring::const_iterator e = in_val.end();
while (b != e)
{
temp += static_cast<char>(*b);
++b;
}
return temp;
}
#endif