WSF
WsfTrackId Class Reference

#include <WsfTrackId.hpp>

Inherits UtScriptAccessible.

Public Member Functions

 WsfTrackId ()
 WsfTrackId (WsfStringId aOwningPlatformId, int aLocalTrackNumber)
const char * GetScriptClassName () const override
bool operator== (const WsfTrackId &aRhs) const
bool operator!= (const WsfTrackId &aRhs) const
bool operator< (const WsfTrackId &aRhs) const
WsfStringId GetOwningPlatformId () const
 Get the owning platform ID (from WsfPlatform::GetNameId());.
void SetOwningPlatformId (WsfStringId aOwningPlatformId)
 Set the owning platform ID (from WsfPlatform::GetNameId());.
int GetLocalTrackNumber () const
 Get the platform-relative local track number.
void SetLocalTrackNumber (int aLocalTrackNumber)
 Set the platform-relative local track number.
bool IsNull () const
 Indicates whether the ID has been set to reference a platform.
int IncrementLocalTrackNumber ()
void Null ()
 Invalidate the ID by zeroing out the owning platform and local track number.

Static Public Member Functions

static std::unique_ptr< UtScriptClass > CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)

Friends

WSF_EXPORT std::ostream & operator<< (std::ostream &aOut, const WsfTrackId &aTrackId)
WSF_EXPORT std::istream & operator>> (std::istream &aIn, WsfTrackId &aTrackId)

Interface for hash_map and hash_set.

The following implements the interface that allows an instance of this class to be used as the function object that defines the hash function for hash_map and hash_set. It could have been defined as a different class, but UtMappedList assumes that hash function is provided by the key class.

hash_map and hash_set are non-standard, but things are defined so they won't be used unless they are available.

size_t operator() (const WsfTrackId &aTrackId) const
 All implementations seem to require this.
bool operator() (const WsfTrackId &aLhs, const WsfTrackId &aRhs) const
 Only Microsoft Developer Studio seems to require this.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.

Detailed Description

Provide unique identification of a track within the simulation.

A 'track ID' is simply a concatenation of two items:

  • The platform ID of 'owner' of the track.
  • The owners local track number of the track.

Constructor & Destructor Documentation

◆ WsfTrackId() [1/2]

WsfTrackId::WsfTrackId ( )
inline

◆ WsfTrackId() [2/2]

WsfTrackId::WsfTrackId ( WsfStringId aOwningPlatformId,
int aLocalTrackNumber )
inline

Member Function Documentation

◆ CreateScriptClass()

std::unique_ptr< UtScriptClass > WsfTrackId::CreateScriptClass ( const std::string & aClassName,
UtScriptTypes * aScriptTypesPtr )
static

Create the 'class' object for the script system. This is invoked once by WsfScriptManager to create the 'class' object that defines the interface to instances of this class from the script system.

Referenced by WsfScriptManager::RegisterTypes().

◆ GetLocalTrackNumber()

◆ GetOwningPlatformId()

◆ GetScriptClassName()

const char * WsfTrackId::GetScriptClassName ( ) const
inlineoverride

◆ IncrementLocalTrackNumber()

int WsfTrackId::IncrementLocalTrackNumber ( )
inline

Increment the local track number. This can be used to increment an object being used as a source of track numbers for the platform.

◆ IsNull()

bool WsfTrackId::IsNull ( ) const
inline

Indicates whether the ID has been set to reference a platform.

Referenced by WsfWeaponTaskManager::AbortFiring(), WsfExplicitWeapon::AbortSalvo(), WsfWeapon::AbortSalvo(), WsfWeapon::ActiveWeaponPlatformsFor(), WsfTaskManager::AssigneesForTask(), WsfQuantumTaskerProcessor::AssignTask(), WsfTaskManager::AssignTask(), WsfWeaponTaskManager::AssignTask(), WsfTaskManager::CancelTask(), WsfNearestNeighborCorrelation::CorrelateImpl(), WsfPerfectCorrelation::CorrelateImpl(), WsfWeapon::EngagementComplete(), WsfTrackManager::FindCorrelatedTrack(), WsfDefaultSensorTracker::GetTargetState(), wsf::space::TargetPointOptions::IsValid(), WsfRF_Repeater::MergedTrackId(), WsfQuantumTaskerProcessor::ProcessTaskAssignMessage(), WsfTaskManager::ProcessTaskAssignMessage(), WsfRF_Repeater::RegisterTrack(), WsfRF_Repeater::RegisterTrackId(), WsfTaskManager::ReleaseResource(), WsfRF_Repeater::RemoveTrackId(), WsfWeapon::RoundsCompleteFor(), WsfWeapon::SalvosFiredAt(), WsfRF_Jammer::SetTargetTrackId(), WsfDefaultSensorTracker::TargetDetected(), WsfQuantumTaskerProcessor::TaskListAssignedForTrack(), WsfQuantumTaskerProcessor::TaskListReceivedForTrack(), WsfQuantumTaskerProcessor::TaskListReceivedOfTypeForTrack(), WsfTaskManager::TasksAssignedFor(), WsfTaskManager::TasksAssignedTo(), WsfTaskManager::TasksReceivedFor(), WsfRIPRProcessor::WeaponFired(), WsfWeaponTaskManager::WeaponFired(), WsfRIPRProcessor::WeaponHit(), WsfRIPRProcessor::WeaponMissed(), WsfWeapon::WeaponsActiveFor(), WsfWeaponTaskManager::WeaponsActiveFor(), WsfWeapon::WeaponsPendingFor(), WsfRIPRProcessor::WeaponTerminated(), and WsfWeaponTaskManager::WeaponTerminated().

◆ Null()

◆ operator!=()

bool WsfTrackId::operator!= ( const WsfTrackId & aRhs) const
inline

Return 'true' if two IDs are 'not equal'.

The two track ID's are not equal if either the owning platform ID or local track number are not equal.

References WsfTrackId().

◆ operator()() [1/2]

bool WsfTrackId::operator() ( const WsfTrackId & aLhs,
const WsfTrackId & aRhs ) const
inline

Only Microsoft Developer Studio seems to require this.

References WsfTrackId().

◆ operator()() [2/2]

size_t WsfTrackId::operator() ( const WsfTrackId & aTrackId) const
inline

All implementations seem to require this.

Microsoft Developer Studio requires the following definitions. They cannot be defined with Developer Studio 6, however, because it causes a compile error.

References GetLocalTrackNumber(), and WsfTrackId().

◆ operator<()

bool WsfTrackId::operator< ( const WsfTrackId & aRhs) const
inline

Return 'true' if 'this' is less than the supplied track ID.

Defining operator< allows objects of this type to be used in sortable containers or by algorithms that use ordering.

References WsfTrackId().

◆ operator==()

bool WsfTrackId::operator== ( const WsfTrackId & aRhs) const
inline

Return 'true' if two track IDs arr 'equal'.

Two track ID's are equal only if both the owning platform ID and local track number are identical.

References WsfTrackId().

◆ Serialize()

template<typename T>
void WsfTrackId::Serialize ( T & aBuff)
inline

For XIO (de)serialization.

◆ SetLocalTrackNumber()

void WsfTrackId::SetLocalTrackNumber ( int aLocalTrackNumber)
inline

Set the platform-relative local track number.

Referenced by operator>>, and SAM_LaunchComputerGenerator::PlaceNewTarget().

◆ SetOwningPlatformId()

void WsfTrackId::SetOwningPlatformId ( WsfStringId aOwningPlatformId)
inline

◆ operator<<

WSF_EXPORT std::ostream & operator<< ( std::ostream & aOut,
const WsfTrackId & aTrackId )
friend

References WsfTrackId().

◆ operator>>

WSF_EXPORT std::istream & operator>> ( std::istream & aIn,
WsfTrackId & aTrackId )
friend

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved