VR-Link JAVA API Documentation
 All Classes Namespaces Files Functions Variables Enumerator Pages
List of all members | Public Member Functions
com.mak.vrlj.vl.ExerciseConnection Interface Referenceabstract

Instances of ExerciseConnection provide an application's interface or connection to the network. More...

+ Inheritance diagram for com.mak.vrlj.vl.ExerciseConnection:
+ Collaboration diagram for com.mak.vrlj.vl.ExerciseConnection:

Public Member Functions

abstract void close () throws Exception
 
abstract void drainInput ()
 Processes input from the exercise. More...
 
abstract void drainInput (double maxTime)
 Processes input from the exercise. More...
 
abstract Clock getClock ()
 Get the Exercise Connection's clock. More...
 
abstract int getNextEventId ()
 Gets the next sequential event identifier. More...
 
abstract int getSite ()
 Gets the configured site identifier. More...
 
abstract int getApplication ()
 Gets the configured application identifier. More...
 
abstract EntityIdentifier getNextEntityIdentifier ()
 Return the EntityIdentifier with the next sequential entity number. More...
 
abstract ObjectPublisher
<?extends BaseObject<?> > 
getPublisher (String classname)
 Gets an object publisher for the named class. More...
 
abstract ObjectPublisher
<?extends BaseObject<?> > 
getPublisher (BaseObject<?extends ObjectIdentifier > obj)
 Gets an object publisher for an object instance. More...
 
abstract
ReflectedObjectCollection
< ObjectIdentifier, BaseObject
<?extends ObjectIdentifier > > 
getReflectedCollection ()
 Gets all reflected objects for this connection. More...
 
abstract void send (Interaction inter)
 Send an interaction to the network. More...
 
void receive (Interaction inter)
 Receive an interaction from the network. More...
 
void addInteractionListener (String interactionName, InteractionListener<?extends Interaction > listener)
 Add a listener for a named interaction. More...
 
void removeInteractionListener (String interactionName, InteractionListener<?extends Interaction > listener)
 Remove a listener for a named interaction. More...
 
void setDefaultHeartbeatRate (float theRate)
 Set the default Heartbeat Rate This is a DIS only settings This only applies to newly created publishers. More...
 
void setDefaultReflectedSmoothingPeriod (float thePeriod)
 Set the default Reflected Smoothing Period. More...
 
void setDefaultThresholds (float theRotationalThreshold, float theTranslationThreshold)
 Set the default Thresholds. More...
 
void setNotifyLevel (NotifyLevel theNotifyLevel)
 Set the notify level for VR-Link's internal logging. More...
 
void setReflectedHeartbeatThreshold (float theRate)
 Set the Reflected Heartbeat Threshold. More...
 
void setSingleReflectedSmoothingPeriod (GlobalObjectDesignator id, float thePeriod)
 Set the Reflected Smoothing Period. More...
 
void vlPrint (String text, NotifyLevel notifyLevel)
 Print using VR-Link's internal logging. More...
 

Detailed Description

Instances of ExerciseConnection provide an application's interface or connection to the network.

In HLA, ExerciseConnection maintains an application's interface to the RTI via the RTI Ambassador. ExerciseConnection also maintains the RTI's connection to the federate via the federate ambassador. An application must continually call drainInput() on the ExerciseConnection so that the LRC (Local RTI Component) may process RTI messages, receive callbacks and perform other housekeeping activities.

In DIS, ExerciseConnection maintains an application's interface to the DIS exercise, and handles all outgoing and incoming PDUs. An application must continually call drainInput() on the ExerciseConnection so that the application may process PDUs, make callbacks and perform other housekeeping activities.

Interactions may be sent using send(), and received by adding a listener to getInteractionDispatcher().

All reflected objects received from the network are stored in a single ReflectedObjectCollection in getReflectedCollection() and may be accessed and iterated without the need to create any ReflectedMap objects if desired.

Member Function Documentation

void com.mak.vrlj.vl.ExerciseConnection.addInteractionListener ( String  interactionName,
InteractionListener<?extends Interaction >  listener 
)

Add a listener for a named interaction.

Parameters
interactionNamethe interaction
listenerthe listener
abstract void com.mak.vrlj.vl.ExerciseConnection.close ( ) throws Exception
pure virtual
abstract void com.mak.vrlj.vl.ExerciseConnection.drainInput ( )
pure virtual

Processes input from the exercise.

It is from within drainInput that user callbacks are executed. This will use a default timeout typically specified in the constructor

abstract void com.mak.vrlj.vl.ExerciseConnection.drainInput ( double  maxTime)
pure virtual

Processes input from the exercise.

It is from within drainInput that user callbacks are executed. If maxTime is negative, then we read all available input without bound on time spent before returning.

Parameters
maxTimeis the approximate maximum time to spend
abstract int com.mak.vrlj.vl.ExerciseConnection.getApplication ( )
pure virtual

Gets the configured application identifier.

Returns
application identifier value.
abstract Clock com.mak.vrlj.vl.ExerciseConnection.getClock ( )
pure virtual

Get the Exercise Connection's clock.

This clock must be set every frame to allow dead reckoning and stamped send calls

Returns
Clock used for simtime by the Exercise Connection

Referenced by com.mak.vrlj.example.f18.VehicleSim.munitionTick(), and com.mak.vrlj.example.f18.VehicleSim.reactToDamage().

abstract EntityIdentifier com.mak.vrlj.vl.ExerciseConnection.getNextEntityIdentifier ( )
pure virtual

Return the EntityIdentifier with the next sequential entity number.

Returns
the next entity identifier.
abstract int com.mak.vrlj.vl.ExerciseConnection.getNextEventId ( )
pure virtual

Gets the next sequential event identifier.

Returns
the sequential event ID.

Referenced by com.mak.vrlj.example.f18.VehicleSim.toggleEmitter(), and com.mak.vrlj.example.f18.VehicleSim.toggleIff().

abstract ObjectPublisher<? extends BaseObject<?> > com.mak.vrlj.vl.ExerciseConnection.getPublisher ( String  classname)
pure virtual

Gets an object publisher for the named class.

Parameters
classnameobject class name.
Returns
an ObjectPublisher for the named object class.

Referenced by com.mak.vrlj.example.f18.VehicleSim.toggleEmitter(), com.mak.vrlj.example.f18.VehicleSim.toggleIff(), and com.mak.vrlj.example.f18.VehicleSim.VehicleSim().

abstract ObjectPublisher<? extends BaseObject<?> > com.mak.vrlj.vl.ExerciseConnection.getPublisher ( BaseObject<?extends ObjectIdentifier >  obj)
pure virtual

Gets an object publisher for an object instance.

Parameters
objobject instance.
Returns
an ObjectPublisher for the object.
abstract ReflectedObjectCollection<ObjectIdentifier, BaseObject<? extends ObjectIdentifier> > com.mak.vrlj.vl.ExerciseConnection.getReflectedCollection ( )
pure virtual

Gets all reflected objects for this connection.

Returns
a ReflectedObjectCollection containing all the objects received on this connection.
abstract int com.mak.vrlj.vl.ExerciseConnection.getSite ( )
pure virtual

Gets the configured site identifier.

Returns
site identifier value.
void com.mak.vrlj.vl.ExerciseConnection.receive ( Interaction  inter)

Receive an interaction from the network.

Parameters
interthe interaction to receive.
void com.mak.vrlj.vl.ExerciseConnection.removeInteractionListener ( String  interactionName,
InteractionListener<?extends Interaction >  listener 
)

Remove a listener for a named interaction.

Parameters
interactionNamethe interaction
listenerthe listener
abstract void com.mak.vrlj.vl.ExerciseConnection.send ( Interaction  inter)
pure virtual

Send an interaction to the network.

Parameters
interthe interaction to send.
void com.mak.vrlj.vl.ExerciseConnection.setDefaultHeartbeatRate ( float  theRate)

Set the default Heartbeat Rate This is a DIS only settings This only applies to newly created publishers.

Parameters
theRateheartbeat rate value.
void com.mak.vrlj.vl.ExerciseConnection.setDefaultReflectedSmoothingPeriod ( float  thePeriod)

Set the default Reflected Smoothing Period.

Parameters
thePeriodsmoothing period value.
void com.mak.vrlj.vl.ExerciseConnection.setDefaultThresholds ( float  theRotationalThreshold,
float  theTranslationThreshold 
)

Set the default Thresholds.

This only applies to newly created publishers.

Parameters
theRotationalThresholdrotational threshold value.
theTranslationThresholdtranslation threshold value.
void com.mak.vrlj.vl.ExerciseConnection.setNotifyLevel ( NotifyLevel  theNotifyLevel)

Set the notify level for VR-Link's internal logging.

Parameters
theNotifyLevelnotify level to use.
void com.mak.vrlj.vl.ExerciseConnection.setReflectedHeartbeatThreshold ( float  theRate)

Set the Reflected Heartbeat Threshold.

Parameters
theRatereflected heartbeat threshold value.
void com.mak.vrlj.vl.ExerciseConnection.setSingleReflectedSmoothingPeriod ( GlobalObjectDesignator  id,
float  thePeriod 
)

Set the Reflected Smoothing Period.

Parameters
idreflected object identifier.
thePeriodsmoothing period value.
void com.mak.vrlj.vl.ExerciseConnection.vlPrint ( String  text,
NotifyLevel  notifyLevel 
)

Print using VR-Link's internal logging.

Parameters
texttext to log.
notifyLevelnotify level to use.

The documentation for this interface was generated from the following file:

Document ID: Generated on Mon Sep 28 00:09:32 EDT 2026 from SVN revision 295353
Copyright © 1992-2025 MAK Technologies. All Rights Reserved (www.mak.com)