The Solar-Stellar Spectrograph

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

ARTICLE

ObArray

The ObArray class maintains an array of objects. It inherits Root. The data member Objects is a pointer to an IDL ObjArr, providing a lightweight way to maintain an array of related objects.

Version History

2008 July 17 - Documentation written.

 

Data Members

pointer Objects

 

Method List

add_tail

cleanup

define

get_at( )

get_size( )

get_type_at( )

init( )

remove_all

set_at

 

Method Descriptions

 

Pro add_tail

argument object ob

Adds an object to the end of the array. It creates a new ObjArr referencing all the objects presently in the array, with an additional ObjArr element at the end. The new object is added and the datamber Objects is first freed and then set to point to the new ObjArr.

 

PRO cleanup

Calls Root::cleanup

Destructor. It destroys each object currently in the object array, and then frees the pointer data member. 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 ObArray class. Used by Obj_New; do not invoke directly.

 

FUNCTION get_at

argument int i

Return object object

Returns the object at index i in the object array. Note this return a reference to the object itself, not a pointer.

 

FUNCTION get_size

Return long howMany

Returns the number of objects presently in the array.

 

FUNCTION get_type_at

Return long type

Returns the type of object at index i in the array, using a call to the IDL function Obj_Class.

 

FUNCTION init

keyword struct _EXTRA

Return bool TRUE

Constructor. It initializes the Root object and creates the data member as a new ObjArr with one element. Never call this function directly; it is invoked by IDL's Obj_New function.

 

PRO remove_all

Destroys all the objects in the array and reinitializes the pointer to by an ObjArr with one element. Note this procedure actually destroys the objects, rather than merely removing a pointer to them.

 

PRO set_at

argument int i

argument object ob

Sets the object at array element i in the ObjArr to be ob.

 

Sample Usage

obj = Obj_New( 'ObArray' )

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.