TReK C++  5.3.3
Telemetry/Command API
trek::CommandTrack Class Reference

This class holds one or more track items for command uplink history. More...

#include <command_track.h>

Public Member Functions

Constructors, Destructor, and Other Basic Methods
 CommandTrack ()
 Default constructor of the class.
 
virtual ~CommandTrack ()
 Class destructor. More...
 
int32_t Update (TrackItem *item_ptr)
 Updates the specficied track item. More...
 
int32_t Update (TrackItem &item)
 Updates the specficied track item. More...
 
int32_t Update (CommandTrack *track_ptr)
 Updates the track with each track item in the input. More...
 
int32_t Update (CommandTrack &input)
 Updates the track with each track item in the input. More...
 
int32_t Find (uint32_t token, TrackItem **track_item_ptr)
 Gets the track item for the specified token. More...
 
void GetAllTrackItems (TrackItemArray &all_items)
 Gets all of the track item. More...
 
void operator= (CommandTrack &right_side)
 Provides the equal operator.
 
void RemoveAllItemsFromMap ()
 Removes all items from the internal track map.
 

Detailed Description

This class holds one or more track items for command uplink history.

Constructor & Destructor Documentation

◆ ~CommandTrack()

trek::CommandTrack::~CommandTrack ( )
virtual

Class destructor.

Removes all resources created with this instance of the class.

Member Function Documentation

◆ Find()

int32_t trek::CommandTrack::Find ( uint32_t  token,
TrackItem **  track_item_ptr 
)

Gets the track item for the specified token.

The returned track item should not be deleted.

Parameters
[in]tokenThe item to find in the track
[out]track_item_ptrUpon SUCCESS, the track item associated with the token
Returns
SUCCESS
CMD_API_DOES_NOT_EXIST

Example:

TrackItem *track_item_ptr;
int32_t ret_value;
ret_value = track.Find( 21, &track_item_ptr );
if( ret_value )
; // don't use the pointer
This class holds one or more track items for command uplink history.
Definition: command_track.h:21
int32_t Find(uint32_t token, TrackItem **track_item_ptr)
Gets the track item for the specified token.
Definition: command_track.cpp:227
This class holds all of the responses associated with a single command uplink. Only methods that are ...
Definition: track_item.h:30

◆ GetAllTrackItems()

void trek::CommandTrack::GetAllTrackItems ( TrackItemArray all_items)

Gets all of the track item.

The returned track items should not be deleted.

Parameters
[out]all_itemsArray of returned track items
Returns
SUCCESS

Example:

TrackItemArray track_item_array;
int32_t ret_value;
ret_value = track.GetAllTrackItems( track_item_array );
for( uint32_t ii = 0; ii < track.Size(); ii++ )
printf( "Token: %u\n", track.GetAt(ii)->GetToken() );
void GetAllTrackItems(TrackItemArray &all_items)
Gets all of the track item.
Definition: command_track.cpp:261
This class provides a wrapper for std::vector so different versions of the standard template library ...
Definition: track_item_array.h:20

◆ Update() [1/4]

int32_t trek::CommandTrack::Update ( CommandTrack input)

Updates the track with each track item in the input.

Parameters
[in]inputThe items to update
Returns
SUCCESS

Example:

CommandTrack track2;
// update track to include everything in track2
track.Update( track2 );
int32_t Update(TrackItem *item_ptr)
Updates the specficied track item.
Definition: command_track.cpp:116

◆ Update() [2/4]

int32_t trek::CommandTrack::Update ( CommandTrack track_ptr)

Updates the track with each track item in the input.

Parameters
[in]track_ptrThe items to update
Returns
SUCCESS

Example:

CommandTrack track2;
// update track to include everything in track2
track.Update( &track2 );

◆ Update() [3/4]

int32_t trek::CommandTrack::Update ( TrackItem item)

Updates the specficied track item.

If the track item already exists, this method will update its contents with the contents of item_ptr. If the track item does not exist, it is added to the map.

Parameters
[in]itemThe new item contents
Returns
SUCCESS

Example:

TrackItem track_item;
track.Update( item );

◆ Update() [4/4]

int32_t trek::CommandTrack::Update ( TrackItem item_ptr)

Updates the specficied track item.

If the track item already exists, this method will update its contents with the contents of item_ptr. If the track item does not exist, it is added to the map.

Parameters
[in]item_ptrThe new item contents
Returns
SUCCESS

Example:

TrackItem track_item;
track.Update( &item );