rtiSimple1516.cxx and rtiSimpleFedAmb1516.cxx (rtiSimpleFedAmb1516.h) have the RTI calls and federate ambassador calls for the HLA 1516 version of rtisimple.
This page has the code for the following files:
rtiSimple1516.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 rti1516;
using namespace std;
FederateHandle theFederateHandle;
std::wstring theClassName = L"BaseEntity";
std::wstring theInterClassName = L"WeaponFire";
ObjectClassHandle theClassHandle;
InteractionClassHandle theInterClassHandle;
ObjectInstanceHandle theObjectHandle;
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;
}
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
<< "\tCould not join federation execution!" << endl;
exit(0);
}
}
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;
}
{
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 1516" << std::endl;
try
{
std::wstring federationName(L"MAKsimple");
std::wstring federationFile(L"MAKsimple.xml");
std::wstring federateType(L"rtisimple1516");
std::vector<std::wstring> args;
if (argc > 1)
{
if (strcmp(argv[1], "-h") == 0)
{
wcout << L"Usage: rtisimple1516 [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)
{
}
theAmbData.clear();
#ifdef WIN32
WSADATA data;
WSAStartup(MAKEWORD(1, 1), &data);
#endif
std::auto_ptr< RTIambassador > rtiAmbAP = rtiAmbFactory->createRTIambassador(args);
rtiAmb = rtiAmbAP.release();
long count=0;
bool doConnect = true;
bool connected = false;
while (1)
{
if (doConnect)
{
doConnect = false;
createFedEx(*rtiAmb, federationName, federationFile);
joinFedEx(*rtiAmb, fedAmb, 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;
}
rtiSimpleFedAmb1516.cxx
#pragma warning(disable: 4251)
#pragma warning(disable: 4786)
#pragma warning(disable: 4290)
#include <iostream>
using namespace std;
using namespace rti1516;
{
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& theObjectInstanceName)
throw (UnknownName, FederateInternalError)
{
wcout << L"objectInstanceNameReservationSucceeded: " << theObjectInstanceName << endl;
myData.nameReservationReturned =
myData.nameReservationSucceeded = true;
}
std::wstring const& theObjectInstanceName)
throw (UnknownName, FederateInternalError)
{
wcout << L"objectInstanceNameReservationFailed: " << theObjectInstanceName << endl;
myData.nameReservationReturned = true;
myData.nameReservationSucceeded = false;
}
ObjectInstanceHandle theObject,
ObjectClassHandle theObjectClass,
std::wstring const& theObjectInstanceName)
throw (CouldNotDiscover, ObjectClassNotKnown, FederateInternalError)
{
wcout << L"discoverObjectInstance: "
<< theObjectInstanceName << L"("
<< theObject.toString() << L") of class "
<< myData.objectClassMap[theObjectClass] << L"( "
<< theObjectClass.toString() << L")" << endl;
myData.objectInstanceMap[theObject] = theObjectInstanceName;
}
ObjectInstanceHandle theObject,
throw (ObjectInstanceNotKnown, AttributeNotRecognized, AttributeNotSubscribed, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"reflectAttributeValues h v u o p: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< L"#attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
ObjectInstanceHandle theObject,
throw (ObjectInstanceNotKnown, AttributeNotRecognized, AttributeNotSubscribed, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"reflectAttributeValues h v u o p r: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< L"#regions: " << theSentRegionHandleSet.size() << L" "
<< L"#attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
ObjectInstanceHandle theObject,
throw (ObjectInstanceNotKnown, AttributeNotRecognized, AttributeNotSubscribed, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"reflectAttributeValues h v u o p t o: "
<< 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 ")
<< L"#attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
ObjectInstanceHandle theObject,
throw (ObjectInstanceNotKnown, AttributeNotRecognized, AttributeNotSubscribed, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"reflectAttributeValues h v u o p t o r: "
<< 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 ")
<< L"#regions: " << theSentRegionHandleSet.size() << L" "
<< L"#attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
ObjectInstanceHandle theObject,
MessageRetractionHandle theHandle)
throw (ObjectInstanceNotKnown, AttributeNotRecognized, AttributeNotSubscribed, InvalidLogicalTime, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"reflectAttributeValues h v u o p t o m: "
<< 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" "
<< L"#attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
ObjectInstanceHandle theObject,
MessageRetractionHandle theHandle,
throw (ObjectInstanceNotKnown, AttributeNotRecognized, AttributeNotSubscribed, InvalidLogicalTime, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"reflectAttributeValues h v u o p t o m r: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< theTime.toString() << L" "
<< theHandle.toString() << L" "
<< L"#regions: " << theSentRegionHandleSet.size() << L" "
<< L"#attributes: " << theAttributeValues.size() << endl;
printAttrValues(theAttributeValues);
}
InteractionClassHandle theInteraction,
throw (InteractionClassNotRecognized, InteractionParameterNotRecognized, InteractionClassNotSubscribed, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"receiveInteraction: "
<< theInteraction.toString() << L" "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< L"#parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
InteractionClassHandle theInteraction,
throw (InteractionClassNotRecognized, InteractionParameterNotRecognized, InteractionClassNotSubscribed,
FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"receiveInteraction: "
<< theInteraction.toString() << L" "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< (theType ==
RELIABLE ? L
"RELIABLE " : L
"BEST_EFFORT ")
<< L"#regions: " << theSentRegionHandleSet.size() << L" "
<< L"#parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
InteractionClassHandle theInteraction,
throw (InteractionClassNotRecognized, InteractionParameterNotRecognized, InteractionClassNotSubscribed, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"receiveInteraction: "
<< 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 ")
<< L"#parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
InteractionClassHandle theInteraction,
throw (InteractionClassNotRecognized, InteractionParameterNotRecognized, InteractionClassNotSubscribed,
FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"receiveInteraction: "
<< 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 ")
<< L"#regions: " << theSentRegionHandleSet.size() << L" "
<< L"#parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
InteractionClassHandle theInteraction,
MessageRetractionHandle theHandle)
throw (InteractionClassNotRecognized, InteractionParameterNotRecognized, InteractionClassNotSubscribed,
InvalidLogicalTime, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"receiveInteraction: "
<< 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" "
<< L"#parameters: " << theParameterValues.size() << endl;
printParamValues(theParameterValues);
}
InteractionClassHandle theInteraction,
MessageRetractionHandle theHandle,
throw (InteractionClassNotRecognized, InteractionParameterNotRecognized, InteractionClassNotSubscribed,
InvalidLogicalTime, FederateInternalError)
{
}
ObjectInstanceHandle theObject,
throw (ObjectInstanceNotKnown, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"removeObjectInstance: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ") << endl;
}
ObjectInstanceHandle theObject,
throw (ObjectInstanceNotKnown, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"removeObjectInstance: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theTime.toString() << L" "
<< (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ") << endl;
}
ObjectInstanceHandle theObject,
MessageRetractionHandle theHandle)
throw (ObjectInstanceNotKnown, InvalidLogicalTime, FederateInternalError)
{
const char* tag = theUserSuppliedTag.size() ? (const char*)theUserSuppliedTag.data() : "";
wcout << L"removeObjectInstance: "
<< myData.objectInstanceMap[theObject] << L"("
<< theObject.toString() << L") "
<< (sentOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theTime.toString() << L" "
<< (receivedOrder ==
RECEIVE ? L
"RECEIVE " : L
"TIMESTAMP ")
<< theHandle.toString() << 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;
}
rtiSimpleFedAmb1516.h
#pragma once
#pragma warning(disable: 4251)
#pragma warning(disable: 4786)
#pragma warning(disable: 4290)
#include <string>
#include <map>
{
public:
{
}
{
}
};
{
public:
std::wstring const & theObjectInstanceName)
throw (rti1516::UnknownName, rti1516::FederateInternalError);
std::wstring const & theObjectInstanceName)
throw (rti1516::UnknownName, rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::ObjectClassHandle theObjectClass,
std::wstring const & theObjectInstanceName)
throw (rti1516::CouldNotDiscover, rti1516::ObjectClassNotKnown, rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
throw (rti1516::ObjectInstanceNotKnown, rti1516::AttributeNotRecognized, rti1516::AttributeNotSubscribed,
rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
throw (rti1516::ObjectInstanceNotKnown,rti1516::AttributeNotRecognized, rti1516::AttributeNotSubscribed,
rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
throw (rti1516::ObjectInstanceNotKnown, rti1516::AttributeNotRecognized, rti1516::AttributeNotSubscribed,
rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
throw (rti1516::ObjectInstanceNotKnown, rti1516::AttributeNotRecognized, rti1516::AttributeNotSubscribed,
rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
rti1516::MessageRetractionHandle theHandle)
throw (rti1516::ObjectInstanceNotKnown, rti1516::AttributeNotRecognized, rti1516::AttributeNotSubscribed,
rti1516::InvalidLogicalTime, rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
rti1516::MessageRetractionHandle theHandle,
throw (rti1516::ObjectInstanceNotKnown, rti1516::AttributeNotRecognized, rti1516::AttributeNotSubscribed,
rti1516::InvalidLogicalTime, rti1516::FederateInternalError);
rti1516::InteractionClassHandle theInteraction,
rti1516::VariableLengthData const & theUserSuppliedTag,
throw (rti1516::InteractionClassNotRecognized, rti1516::InteractionParameterNotRecognized,
rti1516::InteractionClassNotSubscribed, rti1516::FederateInternalError);
rti1516::InteractionClassHandle theInteraction,
rti1516::VariableLengthData const & theUserSuppliedTag,
throw (rti1516::InteractionClassNotRecognized, rti1516::InteractionParameterNotRecognized,
rti1516::InteractionClassNotSubscribed, rti1516::FederateInternalError);
rti1516::InteractionClassHandle theInteraction,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
throw (rti1516::InteractionClassNotRecognized, rti1516::InteractionParameterNotRecognized,
rti1516::InteractionClassNotSubscribed, rti1516::FederateInternalError);
rti1516::InteractionClassHandle theInteraction,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
throw (rti1516::InteractionClassNotRecognized, rti1516::InteractionParameterNotRecognized,
rti1516::InteractionClassNotSubscribed, rti1516::FederateInternalError);
rti1516::InteractionClassHandle theInteraction,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
rti1516::MessageRetractionHandle theHandle)
throw (rti1516::InteractionClassNotRecognized, rti1516::InteractionParameterNotRecognized,
rti1516::InteractionClassNotSubscribed, rti1516::InvalidLogicalTime, rti1516::FederateInternalError);
rti1516::InteractionClassHandle theInteraction,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
rti1516::MessageRetractionHandle theHandle,
throw (rti1516::InteractionClassNotRecognized, rti1516::InteractionParameterNotRecognized,
rti1516::InteractionClassNotSubscribed, rti1516::InvalidLogicalTime, rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
throw (rti1516::ObjectInstanceNotKnown, rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
throw (rti1516::ObjectInstanceNotKnown, rti1516::FederateInternalError);
rti1516::ObjectInstanceHandle theObject,
rti1516::VariableLengthData const & theUserSuppliedTag,
rti1516::LogicalTime const & theTime,
rti1516::MessageRetractionHandle theHandle)
throw (rti1516::ObjectInstanceNotKnown, rti1516::InvalidLogicalTime, rti1516::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