comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » do I really need to use loops on objects?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: do I really need to use loops on objects? [message #18135 is a reply to message #18095] Fri, 03 December 1999 00:00 Go to previous messageGo to previous message
J.D. Smith is currently offline  J.D. Smith
Messages: 214
Registered: August 1996
Senior Member
Struan Gray wrote:
>
> Reading this thread has piqued my curiosity as to what people are
> using arrays of objects for. I like to use IDL_containers instead, as
> they simplify adding and removing objects while maintaining a logical
> order that can be related to numerical array elements if you choose.
> As JD points out you can easily subclass the container, modify the add
> method so it gets picky as to what sort of objects it accepts, and
> provide a DoMethod method to call the relevant method for all the
> contained objects. Are there applications where doing it this way is
> a bad idea (or impossible)?
>
> Struan

If you implement your own IDL_Container-like class, it often contains an
internal object array, though the one I use most contains merely a pointer
array, so the array elements need not be simply objects. Basically, if you have
a collection of objects which need not be intimately related (e.g. if you're
just going to kill them all), an objarr is fine. It's lighter weight than a
container, though less fully featured.

JD

--
J.D. Smith |*| WORK: (607) 255-5842
Cornell University Dept. of Astronomy |*| (607) 255-6263
304 Space Sciences Bldg. |*| FAX: (607) 255-5875
Ithaca, NY 14853 |*|
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Wrong Slice order
Next Topic: Re: Help needed with reading ASCII data

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 01:52:49 PDT 2025

Total time taken to generate the page: 0.16301 seconds