[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

object theoretical question

How computationally expensive is the 'GetByName' method function in the
IDL object graphics objects?

I am building a rather specific object, which contains plot views,
models, plots, etc. among other things. In my object's methods, I will
of course need to access the various members. Is it better to set up
explicit object references in my object definition for the members I
will need to access, or to use the 'GetByName' methods to search through
the various heirarchies to find the object I want?  Or are these two
ways equivalent?

ie. what are the pros/cons of using this approach:

PRO obj__define
    struct = { obj, $
    thisPlot: obj_new(),$
    thingy: obj_new(), $
    anotherThingy: obj_new(), $
    thingyN:obj_new() $
(and using the self.[member]  references directly in the methods)
vs. this approach:

PRO obj__define
    struct = { obj, $
     INHERITS IDL_Container, $            (or inherit IDLgrModel or
whatever is appropriate)
(and use a self->Add method to add objects during the initialization,
and then use a self->Get or self->GetbyName method to find things)


Brad Gom