The Solar-Stellar Spectrograph

[ Home | About | Tech Info & Data | Publications | References ]      [ Site by Jeffrey Hall | Research funded by NSF ]

ARTICLE

DataList

The DataList class implements methods to organize and manipulate an array of data arrays of any type.

Version History

2008 July 18 - Documentation written.

 

Data Members

pointer list

 

Method List

cleanup

define

get_array( )

get_array_at( )

get_array_size( )

get_array_type( )

get_num_arrays( )

init( )

insert_array_at

remove_array_at

reset_list

set_array

set_array_at

 

Method Descriptions

 

PRO cleanup

Destructor. It first frees all the memory allocated to the arrays, and then frees the array pointer list itself. Never call this procedure directly; it is invoked by IDL's Obj_Destroy function.

 

PRO define

Structure definition. Specifies the contents of the IDL structure instantiated by the DataList class. Used by Obj_New; do not invoke directly.

 

FUNCTION get_array

argument int i

Return array array

Returns the array at list index i. The array itself is returned, not a pointer.

 

FUNCTION get_array_at

argument int i

argument int j

Return array array

Returns the jth element of the ith array in the list.

 

FUNCTION get_array_size

Return int howMany

Returns the number of elements in the ith array in the list.

 

FUNCTION get_array_type

Return int howMany

Returns the data type of the ith array in the list.

 

FUNCTION get_num_arrays

Return int howMany

Returns the number of arrays in the list index i.

 

FUNCTION init

keyword int numArrays

Return bool TRUE

Constructor. If the keyword is not set, numArray is set to 1. Self.list is then set to point to a PtrArr of numArrays elements. Thus, a new Datalist object contains a pointer to an array of pointers. Never call this function directly; it is invoked by IDL's Obj_New function.

 

PRO insert_array_at

argument int i

argument int j

argument int val

Inserts the value val as the jth element of the ith array in the list. The length of the array is increased by one, and all elements after the jth element have their indexes increased by one.

 

PRO remove_array_at

argument int i

argument int j

Removes the jth element of the ith array in the list. The length of the array is decreased by one, and all elements after the jth element have their indexes decreased by one.

 

PRO reset_list

argument int i

Reinitializes the list with i arrays. The old data are lost.

 

PRO set_array

argument int i

argument int a

Reinitializes the ith array in the list with array a. The old array is lost.

 

PRO set_array_at

argument int i

argument int j

argument variant v

Sets the jth element of the ith array in the list with value v. The old array is lost.

 

Sample Usage

obj = Obj_New( 'DataList' )

Obj_Destroy( obj )

 


[Back to contents]

Supported by grants from the National Science Foundation.
[ Back to my home page | Email me: jch [at] lowell [dot] edu ]
The SSS is publicly funded. Unless explicitly noted otherwise, everything on this site is in the public domain.
If you use or quote our results or images, we appreciate an acknowledgment.
This site is best viewed with Mozilla Firefox.