|
WSF
|
The WSF Ext is code which is shared between common external interfaces like DIS and HLA. More...
#include <WsfExtInterface.hpp>


Public Types | |
| enum | { cALL_SITES = 0xFFFF , cALL_APPLIC = 0xFFFF , cALL_ENTITIES = 0xFFFF , cNO_SITES = 0 , cNO_APPLIC = 0 , cNO_ENTITY = 0 , cRQST_ASSIGN_ID = 0xFFFE } |
| Public Types inherited from WsfExtData | |
| using | Component = WsfExtInterfaceComponent |
| using | ComponentList = WsfComponentListT<WsfExtInterfaceComponent> |
Public Member Functions | |
| WsfExtInterface (WsfExtInput &aInput) | |
| ~WsfExtInterface () override | |
| void | SimulationComplete (double aSimTime) |
| bool | PrepareExtension () override |
| WsfStringId | SelectPlatformType (const WsfExtEntityType &aEntityType) |
| Given an entity type, select the object type to be used. | |
| WsfPlatform * | CreateExternalPlatform (const std::string &aPlatformType) |
| WsfStringId | GetDefaultPlatformTypeId () |
| Return the type ID of the default platform. | |
| WsfStringId | GetUnknownPlatformTypeId () |
| Return the type ID of the platform mapped to unknown types. | |
| void | SelectEntityId (WsfPlatform *aPlatformPtr, uint16_t &aEntityId) |
| void | FreeEntityId (uint16_t aEntityId) |
| Release an entity ID to be used by another entity. | |
| bool | IsPrivate (const WsfPlatform *aPlatformPtr) const |
| Returns 'true' if aPlatform is a private platform which should not be transmitted to another simulation. | |
| std::set< WsfStringId > & | GetPrivateNameId () |
| std::set< WsfStringId > & | GetPrivateTypeId () |
| WsfCategoryList & | GetPrivateCategoryId () |
| void | AddPrivateType (WsfStringId aTypeId) |
| unsigned short | GetSiteId () |
| unsigned short | GetApplicationId () |
| std::map< WsfStringId, WsfExtEntityType > & | GetObjectToEntityTypeMap () |
| std::map< WsfExtEntityType, WsfStringId > & | GetEntityTypeToObjectMap () |
| bool | IsEntityExternallyMoved (const WsfExtEntityId &aEntityId, const WsfExtEntityType &aEntityType) |
| uint16_t | GetNewEventId () |
| ut::Random & | GetRandom () |
| Get the local random number generator. | |
| double | GetDeferredConnectionTime () const |
| Return the time from the start of the simulation run that external interfaces will open connections. | |
| double | GetDeferredPDUSendTime () const |
| Return the time from the start of the simulation run that DIS PDUs can be sent across external interfaces. | |
| WsfExtEntityDeadReckon * | GetEntityDeadReckon () const |
| uint16_t | AssignNewEntity () |
| std::bitset< 65536U > * | PreassignedEntityIds () |
| std::bitset< 65536U > * | ActiveEntityIds () |
| std::map< WsfStringId, uint16_t > * | PlatformNameToEntityId () |
| Public Member Functions inherited from WsfSimulationExtension | |
| WsfSimulationExtension () | |
| ~WsfSimulationExtension () override=default | |
| WsfSimulation & | GetSimulation () const |
| const WsfScenario & | GetScenario () const |
| virtual void | AddedToSimulation () |
| virtual bool | Initialize () |
| virtual bool | PlatformsInitialized () |
| virtual void | PendingStart () |
| virtual void | Start () |
| virtual void | Complete (double aSimTime) |
| Public Member Functions inherited from WsfExtension | |
| virtual | ~WsfExtension ()=default |
| const std::string & | GetExtensionName () const |
| Public Member Functions inherited from WsfExtData | |
| WsfExtData (WsfScenario &aScenario) | |
| virtual | ~WsfExtData () |
| void | AddComponent (Component *aComponentPtr) |
| const ComponentList & | GetComponents () const |
| virtual bool | ProcessInput (WsfScenario &aScenario, UtInput &aInput) |
| WsfExtEmission * | GetEmission () const |
| bool | ProcessDeadReckonInput (UtInput &aInput) |
| void | ProcessEntityType (UtInput &aInput) |
| void | ProcessRadioEntityType (UtInput &aInput) |
| void | ProcessExternalEntity (UtInput &aInput) |
| void | ProcessExternalType (UtInput &aInput) |
| bool | ProcessEntityId (std::string aName, int aEntityId) |
| void | ProcessEntityId (UtInput &aInput) |
| void | WriteEntityTypes (WsfScenario &aScenario, std::ostream &aStream) |
| Prints entity type mapping for each platform type. | |
| void | WriteEmitterTypes (WsfScenario &aScenario, std::ostream &aStream) |
| Prints entity type mapping for each platform type. | |
| bool | GetEntityType (WsfStringId aObjectTypeId, WsfExtEntityType &aEntityType) const |
| bool | GetRadioEntityType (WsfStringId aCommTypeId, WsfExtRadioEntityType &aEntityType) const |
| bool | GetEntityType (const WsfObject *aObjectPtr, WsfExtEntityType &aEntityType) const |
| Given an object, select a entity type. | |
| int | GetForceId (WsfStringId aSideId) const |
| Return the force ID that corresponds to a given WSF side ID. | |
| WsfStringId | GetSideId (int aForceId) const |
| Return the WSF side ID that corresponds to the given force ID. | |
| void | SelectEntityType (WsfPlatform *aPlatformPtr, WsfExtEntityType &aEntityType) const |
| Given a platform, select an entity type. | |
| WsfStringId | GetStringId (const WsfExtEntityType &aEntityType) const |
| WsfStringId | GetStringId (const WsfExtRadioEntityType &aEntityType) const |
| bool | GetRadioEntityType (const wsf::comm::Comm *aCommPtr, WsfExtRadioEntityType &aEntityType) const |
| Given an object, select a entity type. | |
| bool | CompleteLoad (WsfScenario &aScenario) |
Static Public Member Functions | |
| static WsfExtInterface * | Find (const WsfSimulation &aSimulation) |
| static void | StripExternalPlatform (WsfPlatform *aPlatformPtr) |
| static void | __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr) |
| Static Public Member Functions inherited from WsfExtData | |
| static void | ReadEntityType (UtInput &aInput, WsfExtEntityType &aEntityType) |
| static void | ReadEntityId (UtInput &aInput, WsfExtEntityId &aEntityId) |
| static void | ReadRadioEntityType (UtInput &aInput, WsfExtRadioEntityType &aEntityType) |
| static void | ConvertInputToEntityId (std::string &aInput, WsfExtEntityId &aEntityId) |
| static void | ConvertInputToEntityType (std::string &aInput, WsfExtEntityType &aEntityType) |
| static void | ConvertInputToRadioEntityType (std::string &aInput, WsfExtRadioEntityType &aEntityType) |
Additional Inherited Members | |
| Protected Member Functions inherited from WsfExtension | |
| void | InitializeExtensionName (const std::string &aName) |
| Protected Attributes inherited from WsfExtData | |
| ComponentList | mComponents |
The WSF Ext is code which is shared between common external interfaces like DIS and HLA.
| anonymous enum |
| WsfExtInterface::WsfExtInterface | ( | WsfExtInput & | aInput | ) |
References cALL_ENTITIES, cNO_ENTITY, cRQST_ASSIGN_ID, WsfExtData::mEmissionPtr, WsfExtData::mPreassignedEntityIds, and WsfExtData::WsfExtData().
Referenced by Find().
|
override |
|
inline |
| void WsfExtInterface::AddPrivateType | ( | WsfStringId | aTypeId | ) |
References WsfExtData::mPrivateTypeId.
| uint16_t WsfExtInterface::AssignNewEntity | ( | ) |
References cALL_ENTITIES, cNO_ENTITY, and cRQST_ASSIGN_ID.
Referenced by SelectEntityId().
| WsfPlatform * WsfExtInterface::CreateExternalPlatform | ( | const std::string & | aPlatformType | ) |
References WsfPlatformTypes::Get(), WsfSimulationExtension::GetScenario(), and platformPtr.
Referenced by SimulationComplete().
|
static |
References WsfSimulation::FindExtension(), WsfExtInterface(), and WsfSimulationExtension::WsfSimulation.
Referenced by wsf::simdis::Interface::AddedToSimulation(), wsf::coverage::RectangularGrid::PreparePlatforms(), WsfMilExtInterface::SelectWeaponType(), wsf::dis::ScenarioExtension::SimulationCreated(), wsf::ext::UT_DEFINE_SCRIPT_METHOD_EXT(), WsfXIO_AutoDisMapping::WsfXIO_AutoDisMapping(), and WsfXIO_PlatformInfoService::WsfXIO_PlatformInfoService().
| void WsfExtInterface::FreeEntityId | ( | uint16_t | aEntityId | ) |
Release an entity ID to be used by another entity.
|
inline |
References WsfExtData::mApplicationId.
|
inline |
Return the type ID of the default platform.
|
inline |
Return the time from the start of the simulation run that external interfaces will open connections.
References WsfExtData::mDeferredConnectionTime.
Referenced by WsfStandardApplication::UpdateOptionsP(), and WsfDisPlatform::WsfDisPlatform().
|
inline |
Return the time from the start of the simulation run that DIS PDUs can be sent across external interfaces.
References WsfExtData::mDeferredPDUSendTime.
|
inline |
|
inline |
References WsfExtData::mEntityTypeToObjectType.
Referenced by WsfMilExtInterface::SelectWeaponType().
| uint16_t WsfExtInterface::GetNewEventId | ( | ) |
|
inline |
References WsfExtData::mObjectTypeToEntityType.
|
inline |
References WsfExtData::mPrivateCategoryId.
|
inline |
References WsfExtData::mPrivateNameId.
|
inline |
References WsfExtData::mPrivateTypeId.
|
inline |
Get the local random number generator.
Referenced by PrepareExtension().
|
inline |
References WsfExtData::mSiteId.
|
inline |
Return the type ID of the platform mapped to unknown types.
References WsfExtData::mUnknownPlatformTypeId.
| bool WsfExtInterface::IsEntityExternallyMoved | ( | const WsfExtEntityId & | aEntityId, |
| const WsfExtEntityType & | aEntityType ) |
References WsfExtData::mExternalEntityIds, and WsfExtData::mExternalEntityTypes.
| bool WsfExtInterface::IsPrivate | ( | const WsfPlatform * | aPlatformPtr | ) | const |
Returns 'true' if aPlatform is a private platform which should not be transmitted to another simulation.
References WsfPlatform::GetCategories(), WsfObject::GetNameId(), WsfObject::GetTypeId(), WsfExtData::mAllPrivate, WsfExtData::mPrivateCategoryId, WsfExtData::mPrivateNameId, and WsfExtData::mPrivateTypeId.
|
inline |
References WsfExtData::mPlatformNameToEntityId.
|
inline |
References WsfExtData::mPreassignedEntityIds.
|
overridevirtual |
Called in response to a call to WsfSimulation::Initialize and WsfSimulation::PrepareSimulation.
A simulation extension will typically implement either WsfSimulationExtension::Initialize or WsfSimulationExtension::PrepareExtension, or a combination of both. The main difference is that:
The primary criteria for deciding which method to use is to look at the extension and see if it uses any external resources such as files or sockets. If the extension uses external resources and wants to support snapshotting then it MUST use this this method so it can (re)establish connections to external resources (A snapshot cannot save the state of an open file or socket and so it must be reopened.)
Reimplemented from WsfSimulationExtension.
References WsfSimulation::AddEvent(), ConnectionComplete, GetRandom(), WsfSimulationExtension::GetSimulation(), WsfExtData::mDeferredConnectionTime, WsfExtData::mSideIdToForceId, and WsfExtData::mStartEntity.
Referenced by SimulationComplete().
| void WsfExtInterface::SelectEntityId | ( | WsfPlatform * | aPlatformPtr, |
| uint16_t & | aEntityId ) |
Given a platform, select an entity id. Call FreeEntityId() when the ID is no longer assigned to the platform
References AssignNewEntity(), WsfObject::GetName(), WsfObject::GetNameId(), WsfExtData::mPlatformNameToEntityId, and WsfExtData::mPreassignedEntityIds.
| WsfStringId WsfExtInterface::SelectPlatformType | ( | const WsfExtEntityType & | aEntityType | ) |
Given an entity type, select the object type to be used.
References WsfPlatformTypes::Get(), WsfSimulationExtension::GetScenario(), WsfExtData::mEntityTypeToObjectType, WsfExtEntityType::mExtra, WsfExtEntityType::mSpecific, WsfExtEntityType::mSubcategory, and WsfExtData::mUnknownPlatformTypeId.
Referenced by SimulationComplete().
| void WsfExtInterface::SimulationComplete | ( | double | aSimTime | ) |
References CreateExternalPlatform(), PrepareExtension(), SelectPlatformType(), and StripExternalPlatform().
|
static |
| UtCallbackListN<void(double)> WsfExtInterface::ConnectionComplete |
Referenced by PrepareExtension(), and WsfDisVisualization::WsfDisVisualization().