Turok
 
Loading...
Searching...
No Matches
array< T > Class Template Reference

Public Member Functions

void insertAt (uint index, const T &in value)
 Inserts a new element into the array at the specified index.
 
void insertAt (uint index, const T[]&inout arr)
 Inserts another array of elements into the array at the specified index.
 
void insertLast (const T &in value)
 Appends an element at the end of the array.
 
void removeAt (uint index)
 Removes the element at the specified index.
 
void removeLast ()
 Removes the last element of the array.
 
void removeRange (uint start, uint count)
 Removes count elements starting from start.
 
uint length () const
 Returns the length of the array.
 
void reserve (uint length)
 
void resize (uint length)
 Sets the new length of the array.
 
void sortAsc ()
 Sorts the elements in the array in ascending order. For object types, this will use the type's opCmp method.
 
void sortAsc (uint startAt, uint count)
 Sorts only the elements starting at index startAt and the following count elements in the array in ascending order. For object types, this will use the type's opCmp method.
 
void sortDesc ()
 Sorts the elements in the array in descending order. For object types, this will use the type's opCmp method.
 
void sortDesc (uint startAt, uint count)
 Sorts only the elements starting at index startAt and the following count elements in the array in descending order. For object types, this will use the type's opCmp method.
 
void reverse ()
 Reverses the order of the elements in the array.
 
int find (const T &in value) const
 Returns the index of the first element that has the same value as the wanted value. For object types, this will use the type's opEquals or opCmp method to compare the value. For arrays of handles any null handle will be skipped. If no match is found will return a negative value.
 
int find (uint startAt, const T &in value) const
 Returns the index of the first element that has the same value as the wanted value. For object types, this will use the type's opEquals or opCmp method to compare the value. For arrays of handles any null handle will be skipped. If no match is found will return a negative value.
 
int findByRef (const T &in value) const
 Searches for a matching address. These are especially useful for arrays of handles where specific instances of objects are desired, and not just objects that happen to have equal value. If no match is found will return a negative value.
 
int findByRef (uint startAt, const T &in value) const
 Searches for a matching address. These are especially useful for arrays of handles where specific instances of objects are desired, and not just objects that happen to have equal value. If no match is found will return a negative value.
 
bool isEmpty () const
 
T & opIndex (uint index)
 
const T & opIndex (uint index) const
 
T &[] opAssign (const T[]&in)
 
bool opEquals (const T[]&in) const
 
funcdef bool less (const ?&in a, const ?&in b)
 sorting function for sort
 
void sort (less &in, uint startAt=0, uint count=uint(- 1))
 sorts array using the passed in less function
 

Detailed Description

template<class T>
class array< T >

Definition at line 540 of file t1_scriptAPI.cpp.

Member Function Documentation

◆ find() [1/2]

template<class T>
int array< T >::find ( const T &in value) const

Returns the index of the first element that has the same value as the wanted value. For object types, this will use the type's opEquals or opCmp method to compare the value. For arrays of handles any null handle will be skipped. If no match is found will return a negative value.

◆ find() [2/2]

template<class T>
int array< T >::find ( uint startAt,
const T &in value ) const

Returns the index of the first element that has the same value as the wanted value. For object types, this will use the type's opEquals or opCmp method to compare the value. For arrays of handles any null handle will be skipped. If no match is found will return a negative value.

◆ findByRef() [1/2]

template<class T>
int array< T >::findByRef ( const T &in value) const

Searches for a matching address. These are especially useful for arrays of handles where specific instances of objects are desired, and not just objects that happen to have equal value. If no match is found will return a negative value.

◆ findByRef() [2/2]

template<class T>
int array< T >::findByRef ( uint startAt,
const T &in value ) const

Searches for a matching address. These are especially useful for arrays of handles where specific instances of objects are desired, and not just objects that happen to have equal value. If no match is found will return a negative value.

◆ insertAt() [1/2]

template<class T>
void array< T >::insertAt ( uint index,
const T &in value )

Inserts a new element into the array at the specified index.

◆ insertAt() [2/2]

template<class T>
void array< T >::insertAt ( uint index,
const T &[]inout arr )

Inserts another array of elements into the array at the specified index.

◆ insertLast()

template<class T>
void array< T >::insertLast ( const T &in value)

Appends an element at the end of the array.

◆ isEmpty()

template<class T>
bool array< T >::isEmpty ( ) const

◆ length()

template<class T>
uint array< T >::length ( ) const

Returns the length of the array.

◆ less()

template<class T>
funcdef bool array< T >::less ( const ?&in a,
const ?&in b )

sorting function for sort

◆ opAssign()

template<class T>
T &[] array< T >::opAssign ( const T &[] in)

◆ opEquals()

template<class T>
bool array< T >::opEquals ( const T &[] in) const

◆ opIndex() [1/2]

template<class T>
T & array< T >::opIndex ( uint index)

◆ opIndex() [2/2]

template<class T>
const T & array< T >::opIndex ( uint index) const

◆ removeAt()

template<class T>
void array< T >::removeAt ( uint index)

Removes the element at the specified index.

◆ removeLast()

template<class T>
void array< T >::removeLast ( )

Removes the last element of the array.

◆ removeRange()

template<class T>
void array< T >::removeRange ( uint start,
uint count )

Removes count elements starting from start.

◆ reserve()

template<class T>
void array< T >::reserve ( uint length)

◆ resize()

template<class T>
void array< T >::resize ( uint length)

Sets the new length of the array.

◆ reverse()

template<class T>
void array< T >::reverse ( )

Reverses the order of the elements in the array.

◆ sort()

template<class T>
void array< T >::sort ( less & in,
uint startAt = 0,
uint count = uint(- 1) )

sorts array using the passed in less function

◆ sortAsc() [1/2]

template<class T>
void array< T >::sortAsc ( )

Sorts the elements in the array in ascending order. For object types, this will use the type's opCmp method.

◆ sortAsc() [2/2]

template<class T>
void array< T >::sortAsc ( uint startAt,
uint count )

Sorts only the elements starting at index startAt and the following count elements in the array in ascending order. For object types, this will use the type's opCmp method.

◆ sortDesc() [1/2]

template<class T>
void array< T >::sortDesc ( )

Sorts the elements in the array in descending order. For object types, this will use the type's opCmp method.

◆ sortDesc() [2/2]

template<class T>
void array< T >::sortDesc ( uint startAt,
uint count )

Sorts only the elements starting at index startAt and the following count elements in the array in descending order. For object types, this will use the type's opCmp method.