Logo
Telescience Resource Kit
TReK Python  5.4.0 ART
TrackItemArray Class Reference

Zero-based array of TrackItem's. More...

Public Member Functions

Initialize / Finalize

Functions handling class initialization and finalization.

def TrackItemArray ( Optional[TrackItemArray] tracked_item_array=None, Optional[c_void_p] native_ptr=None -> def ) -> def 
 Class initializer. More...
 
def clone ( -> TrackItemArray ) -> def 
 Creates a new instance of the object with the same contents.
 
def copy (copy_from: object -> None ) -> def 
 Copies the contents of the provided 'copy_from' TrackItemArray. More...
 
Array Management

Functions handling contents of the array.

def append (item: TrackItem -> None ) -> def 
 Adds the item to the end of the array. More...
 
def clear ( -> None ) -> def 
 Removes all of the items from the array.
 
def __getitem__ (key: int -> Optional[TrackItem] ) -> def 
 Return the item at the given index key. More...
 
def __setitem__ (key: int, track_item: TrackItem -> None ) -> def 
 Replaces the item at the given location. More...
 
def __len__ ( -> int ) -> def 
 Returns the number of TrackItem's in the array. More...
 

Detailed Description

Zero-based array of TrackItem's.

Constructor & Destructor Documentation

◆ TrackItemArray()

(tracked_item_array : Optional[TrackItemArray]  
native_ptr : Optional[c_void_p]  
) -> def

Class initializer.

Parameters
[in]tracked_item_array(Optional) TrackItemArray to copy.
[in]native_ptr(Optional) Internal parameter, do not provide.

Member Function Documentation

◆ __getitem__()

(key : int ) -> Optional[TrackItem]

Return the item at the given index key.

track_item = my_array[0]
Parameters
[in]keyThe index for which to get item (>= 0).
Returns
TrackedItem if within (0 to len()).
Exceptions
IndexErrorif index < 0 or > len().

◆ __len__()

() -> int

Returns the number of TrackItem's in the array.

size = len(my_array)

◆ __setitem__()

(key : int 
track_item : TrackItem 
) -> None

Replaces the item at the given location.

A copy of the item is made.

my_array[0] = track_item
Exceptions
IndexErrorif index < 0 or > len().

◆ append()

(item : TrackItem ) -> None

Adds the item to the end of the array.

Parameters
[in]itemThe item to the end of the array. Item is copied.

◆ copy()

(copy_from : object ) -> None

Copies the contents of the provided 'copy_from' TrackItemArray.

Parameters
[in]copy_fromTrackItemArray to copy from.
Exceptions
TypeErrorif 'copy_from' is not a TrackItemArray.