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

Home » Public Forums » archive » Re: Object-Oriented Programming Question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Object-Oriented Programming Question [message #10532] Thu, 18 December 1997 00:00
rivers is currently offline  rivers
Messages: 228
Registered: March 1991
Senior Member
In article <34986079.BC1BBB4F@pppl.gov>, Peter Stoltz <pstoltz@pppl.gov> writes:
>> Hi everyone-
>
> I have finally gotten around to trying out object-oriented programming
> with IDL, and I have a question about data encapsulation.
>
> I define an object structure A that has as one of its data members
> another object B (A has a B). So far as I can tell, when one creates an
>
> instance of A, one cannot invoke the methods of class B through the
> syntax
>
> IDL> a=obj_new('A')
> IDL> a.b->some_method
>
> % Object instance data is not visible outside class methods
> % Execution halted

It's much simpler:

IDL> a->some_method

will invoke member b's "some_method". This works fine as long as "some_method"
is not "overloaded", i.e. "a" does not have a routine of the same name. If it
does, then you will get "a's" version by default. There is a syntax which will
allow access to b's method even in this case. I forget it, but it's in the
manual.

____________________________________________________________
Mark Rivers (773) 702-2279 (office)
CARS (773) 702-9951 (secretary)
Univ. of Chicago (773) 702-5454 (FAX)
5640 S. Ellis Ave. (708) 922-0499 (home)
Chicago, IL 60637 rivers@cars.uchicago.edu (e-mail)

or:
Argonne National Laboratory (630) 252-0422 (office)
Building 434A (630) 252-0405 (lab)
9700 South Cass Avenue (630) 252-1713 (beamline)
Argonne, IL 60439 (630) 252-0443 (FAX)
Re: Object-Oriented Programming Question [message #10533 is a reply to message #10532] Wed, 17 December 1997 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Peter Stoltz (pstoltz@pppl.gov) writes:

> I have finally gotten around to trying out object-oriented programming
> with IDL, and I have a question about data encapsulation.
>
> I define an object structure A that has as one of its data members
> another object B (A has a B). So far as I can tell, when one creates
> an instance of A, one cannot invoke the methods of class B through
> the syntax
>
> IDL> a=obj_new('A')
> IDL> a.b->some_method

I think the correct syntax is this:

a->b::some_method

This will search the superclass b and any of its superclasses.

> Also, is there a mailing list or anything specifically about
> object-oriented programming in IDL?

This is a good idea. I've been thinking about some kind of
programming newsletter. Maybe when I have some time...

Cheers,

David

-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Help: Countlines on Win 95 version of IDL
Next Topic: resizing draw widget

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

Current Time: Sun Oct 12 06:40:42 PDT 2025

Total time taken to generate the page: 1.20754 seconds