VR-Link API Documentation for HLA 1.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Simple Test Interaction application

This file contains the Simple Test Interaction application, which sends and receives Simple Test Interactions.


/****************************************************************************
* Copyright (c) 2014 VT MAK
* All rights reserved.
****************************************************************************/
#include "testSimpInter.h"
#include <iostream>
// Callback function to be called when a TestSimpleInteraction is received.
void testCb( TestSimpleInteraction* inter, void* )
{
std::cout << "Received Test Interaction!" << std::endl;
inter->print();
std::cout << std::endl;
}
int main( int argc, char* argv[] )
{
// Used for error handling
DtINIT_MINIDUMPER( "SimpleInterTest" );
DtExerciseConn conn("example-vrlExtend", "TestInter", (DtFomMapper*) NULL);
DtClock* clock = conn.clock();
// Register the callback on incoming TestInteractions.
TestSimpleInteraction::addCallback(&conn, testCb, NULL);
while (1)
{
clock->setSimTime(clock->absRealTime());
conn.drainInput();
// Send a TestSimpleInteraction.
inter.setNumber(10);
inter.setVector(DtVector(1.0, 2.0, 3.0));
conn.sendStamped(inter);
DtSleep(1.0);
}
return 0;
}

Document ID: Generated on Tue Mar 1 02:56:17 EST 2016 from SVN revision 162687
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)