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... | |
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.
| void com.mak.vrlj.vl.ExerciseConnection.addInteractionListener | ( | String | interactionName, |
| InteractionListener<?extends Interaction > | listener | ||
| ) |
Add a listener for a named interaction.
| interactionName | the interaction |
| listener | the listener |
|
pure virtual |
Implements com.mak.vrlj.vl.AutoCloseable.
|
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
|
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.
| maxTime | is the approximate maximum time to spend |
|
pure virtual |
Gets the configured application identifier.
|
pure virtual |
Get the Exercise Connection's clock.
This clock must be set every frame to allow dead reckoning and stamped send calls
Referenced by com.mak.vrlj.example.f18.VehicleSim.munitionTick(), and com.mak.vrlj.example.f18.VehicleSim.reactToDamage().
|
pure virtual |
Return the EntityIdentifier with the next sequential entity number.
|
pure virtual |
Gets the next sequential event identifier.
Referenced by com.mak.vrlj.example.f18.VehicleSim.toggleEmitter(), and com.mak.vrlj.example.f18.VehicleSim.toggleIff().
|
pure virtual |
Gets an object publisher for the named class.
| classname | object class name. |
Referenced by com.mak.vrlj.example.f18.VehicleSim.toggleEmitter(), com.mak.vrlj.example.f18.VehicleSim.toggleIff(), and com.mak.vrlj.example.f18.VehicleSim.VehicleSim().
|
pure virtual |
Gets an object publisher for an object instance.
| obj | object instance. |
|
pure virtual |
Gets all reflected objects for this connection.
|
pure virtual |
Gets the configured site identifier.
| void com.mak.vrlj.vl.ExerciseConnection.receive | ( | Interaction | inter | ) |
Receive an interaction from the network.
| inter | the interaction to receive. |
| void com.mak.vrlj.vl.ExerciseConnection.removeInteractionListener | ( | String | interactionName, |
| InteractionListener<?extends Interaction > | listener | ||
| ) |
Remove a listener for a named interaction.
| interactionName | the interaction |
| listener | the listener |
|
pure virtual |
Send an interaction to the network.
| inter | the 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.
| theRate | heartbeat rate value. |
| void com.mak.vrlj.vl.ExerciseConnection.setDefaultReflectedSmoothingPeriod | ( | float | thePeriod | ) |
Set the default Reflected Smoothing Period.
| thePeriod | smoothing period value. |
| void com.mak.vrlj.vl.ExerciseConnection.setDefaultThresholds | ( | float | theRotationalThreshold, |
| float | theTranslationThreshold | ||
| ) |
Set the default Thresholds.
This only applies to newly created publishers.
| theRotationalThreshold | rotational threshold value. |
| theTranslationThreshold | translation threshold value. |
| void com.mak.vrlj.vl.ExerciseConnection.setNotifyLevel | ( | NotifyLevel | theNotifyLevel | ) |
Set the notify level for VR-Link's internal logging.
| theNotifyLevel | notify level to use. |
| void com.mak.vrlj.vl.ExerciseConnection.setReflectedHeartbeatThreshold | ( | float | theRate | ) |
Set the Reflected Heartbeat Threshold.
| theRate | reflected heartbeat threshold value. |
| void com.mak.vrlj.vl.ExerciseConnection.setSingleReflectedSmoothingPeriod | ( | GlobalObjectDesignator | id, |
| float | thePeriod | ||
| ) |
Set the Reflected Smoothing Period.
| id | reflected object identifier. |
| thePeriod | smoothing period value. |
| void com.mak.vrlj.vl.ExerciseConnection.vlPrint | ( | String | text, |
| NotifyLevel | notifyLevel | ||
| ) |
Print using VR-Link's internal logging.
| text | text to log. |
| notifyLevel | notify level to use. |