WSF
WsfTrackListT< T > Class Template Reference

A 'Track List' is a container for a list of 'Track' objects. More...

#include <WsfTrackList.hpp>

Public Member Functions

 WsfTrackListT ()=default
 WsfTrackListT (const WsfTrackListT< T > &aSrc)
WsfTrackListT< T > & operator= (const WsfTrackListT< T > &aRhs)=delete
virtual ~WsfTrackListT ()=default
void AddTrack (std::unique_ptr< T > aTrackPtr)
 Add a track to the track list.
unsigned int GetTrackCount () const
T * GetTrackEntry (unsigned int aEntryIndex)
const T * GetTrackEntry (unsigned int aEntryIndex) const
WsfTrackListT< T > * Clone () const
 Clone this object.
bool DeleteTrack (const WsfTrackId &aTrackId)
 Delete the indicated track from the track list and delete the track object.
unsigned int DeleteTrackEntry (unsigned int aEntryIndex)
void DeleteAllTracks ()
 Delete all the tracks in the track list.
T * FindTrack (const WsfTrackId &aTrackId)
 Find the requested track.
const T * FindTrack (const WsfTrackId &aTrackId) const
 Find the requested track.
std::unique_ptr< T > RemoveTrack (const WsfTrackId &aTrackId)
 Remove the indicated track from the track list but don't delete the track object itself.

Detailed Description

template<class T>
class WsfTrackListT< T >

A 'Track List' is a container for a list of 'Track' objects.

This class is templatized; WsfTrackListFwd.hpp includes the following standard track lists (typedefs):

Please "#include" this file (WsfTrackListFwd.hpp) in header files where you only need pointers or references to either of these track list types. "#include" this file (WsfTrackList.hpp) wherever the track lists themselves are declared or defined.

Constructor & Destructor Documentation

◆ WsfTrackListT() [1/2]

template<class T>
WsfTrackListT< T >::WsfTrackListT ( )
default

◆ WsfTrackListT() [2/2]

template<class T>
WsfTrackListT< T >::WsfTrackListT ( const WsfTrackListT< T > & aSrc)

References AddTrack(), trackPtr, and WsfTrackListT().

◆ ~WsfTrackListT()

template<class T>
virtual WsfTrackListT< T >::~WsfTrackListT ( )
virtualdefault

Member Function Documentation

◆ AddTrack()

template<class T>
void WsfTrackListT< T >::AddTrack ( std::unique_ptr< T > aTrackPtr)

Add a track to the track list.

Parameters
aTrackPtrPointer to the track to be added. This class takes ownership of the track object.
Note
It is the callers responsibility to ensure that another track with the same track ID does not already exist in the list.

Referenced by WsfDefaultSensorTracker::GetActiveTrackList(), WsfCorrelationStrategy::TestCorrelation(), WsfCompositeSensor::UpdateCompositeTrack(), and WsfTrackListT().

◆ Clone()

template<class T>
WsfTrackListT< T > * WsfTrackListT< T >::Clone ( ) const
inline

◆ DeleteAllTracks()

template<class T>
void WsfTrackListT< T >::DeleteAllTracks ( )

Delete all the tracks in the track list.

◆ DeleteTrack()

template<class T>
bool WsfTrackListT< T >::DeleteTrack ( const WsfTrackId & aTrackId)

Delete the indicated track from the track list and delete the track object.

Parameters
aTrackIdThe track ID of the track to be deleted.
Returns
true if requested track was found and deleted.
false if the requested track was not found.

Referenced by DeleteTrackEntry(), WsfCompositeSensor::DropContributorTrack(), and WsfPerfectTracker::NullTrack().

◆ DeleteTrackEntry()

template<class T>
unsigned int WsfTrackListT< T >::DeleteTrackEntry ( unsigned int aEntryIndex)

Delete a track entry from the track list, returning the next valid entry. If there is no next valid entry, or if the entry to be deleted is out-of-bounds, the value of GetTrackCount() will be returned.

References DeleteTrack().

◆ FindTrack() [1/2]

◆ FindTrack() [2/2]

template<class T>
const T * WsfTrackListT< T >::FindTrack ( const WsfTrackId & aTrackId) const

Find the requested track.

This version returns a const pointer to the track.

Parameters
aTrackIdThe track ID of the track to be located.
Returns
Pointer to track or nullptr if the requested track could not be found.

References FindTrack(), and WsfTrackListT().

◆ GetTrackCount()

◆ GetTrackEntry() [1/2]

◆ GetTrackEntry() [2/2]

template<class T>
const T * WsfTrackListT< T >::GetTrackEntry ( unsigned int aEntryIndex) const
inline

Get a track from the track list by its entry index (offset) into the list. This version returns a const-pointer to the track.

Parameters
aEntryIndexIndex of the desired entry. The index must be in the range 0 <= aEntryIndex < GetTrackCount().

◆ operator=()

template<class T>
WsfTrackListT< T > & WsfTrackListT< T >::operator= ( const WsfTrackListT< T > & aRhs)
delete

◆ RemoveTrack()

template<class T>
std::unique_ptr< T > WsfTrackListT< T >::RemoveTrack ( const WsfTrackId & aTrackId)

Remove the indicated track from the track list but don't delete the track object itself.

Parameters
aTrackIdThe track ID of the track to be removed.
Returns
Pointer to track or nullptr if the requested track could not be found.

References trackPtr.

Referenced by WsfWeaponTrackProcessor::ProcessTrackDrop().


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