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 ()
 
abstract int getSite ()
 
abstract int getApplication ()
 
abstract EntityIdentifier getNextEntityIdentifier ()
 Return the EntityIdentifier with the next sequential entity number. More...
 
abstract ObjectPublisher
<?extends BaseObject<?> > 
getPublisher (String classname)
 
abstract ObjectPublisher
<?extends BaseObject<?> > 
getPublisher (BaseObject<?extends ObjectIdentifier > obj)
 
abstract
ReflectedObjectCollection
< ObjectIdentifier, BaseObject
<?extends ObjectIdentifier > > 
getReflectedCollection ()
 
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
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
abstract ObjectPublisher<? extends BaseObject<?> > com.mak.vrlj.vl.ExerciseConnection.getPublisher ( String  classname)
pure virtual
abstract ObjectPublisher<? extends BaseObject<?> > com.mak.vrlj.vl.ExerciseConnection.getPublisher ( BaseObject<?extends ObjectIdentifier obj)
pure virtual
Returns
an ObjectPublisher for the object.
abstract ReflectedObjectCollection<ObjectIdentifier, BaseObject<? extends ObjectIdentifier> > com.mak.vrlj.vl.ExerciseConnection.getReflectedCollection ( )
pure virtual
Returns
a ReflectedObjectCollection containing all the objects received on this connection.
abstract int com.mak.vrlj.vl.ExerciseConnection.getSite ( )
pure virtual
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
theRate
void com.mak.vrlj.vl.ExerciseConnection.setDefaultReflectedSmoothingPeriod ( float  thePeriod)

Set the default Reflected Smoothing Period.

Parameters
thePeriod
void com.mak.vrlj.vl.ExerciseConnection.setDefaultThresholds ( float  theRotationalThreshold,
float  theTranslationThreshold 
)

Set the default Thresholds.

This only applies to newly created publishers.

Parameters
theRotationalThreshold
theTranslationThreshold
void com.mak.vrlj.vl.ExerciseConnection.setNotifyLevel ( NotifyLevel  theNotifyLevel)

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

Parameters
theNotifyLevel
void com.mak.vrlj.vl.ExerciseConnection.setReflectedHeartbeatThreshold ( float  theRate)

Set the Reflected Heartbeat Threshold.

Parameters
theRate
void com.mak.vrlj.vl.ExerciseConnection.setSingleReflectedSmoothingPeriod ( GlobalObjectDesignator  id,
float  thePeriod 
)

Set the Reflected Smoothing Period.

Parameters
id
thePeriod
void com.mak.vrlj.vl.ExerciseConnection.vlPrint ( String  text,
NotifyLevel  notifyLevel 
)

Print using VR-Link's internal logging.

Parameters
text
notifyLevel

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

Document ID: Generated on Thu Sep 19 02:12:35 EDT 2024 from SVN revision 269601
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)