|
WSF
|
This section provides general programming notes when using WSF.
WsfSimulation maintains a list of all active platforms in the simulation. It includes methods for determining if a platform exists, iterating over all active platforms, etc.
Platforms may be destroyed during a simulation. Therefore, an object (simulation observer, another platform, etc.) must not retain a pointer to another platform as there is no way to guarantee that the platform will always exist. What should be retained is a 'platform index'.
When a platform is added to the simulation it is assigned a unique platform index that will never be reassigned during the simulation (Note: the platform index is not assigned until WsfSimulation::Initialize is called). The platform index for an active platform can be retrieved by:
Given a platform index, the address of the associated platform can be retrieved by:
The return value will be the pointer to the platform if it still exists or 0 if the platform has been removed from the simulation.
What do you want to do next?