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

Home » Public Forums » archive » Need advice about inheritance
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: Need advice about inheritance [message #44196 is a reply to message #44098] Sat, 21 May 2005 16:46 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
wcramer writes:

> I have two classes:
>
> ------
> "data": maintains a list of x, y data values and provide methods for
> operations between two "data" classes (i.e., "multiply", "add", etc.)
>
> "timedata": inherits "data" and treats x as time and y as value data
> ------
>
> Methods such as "add" should return another object instance of the same
> class as "self". Is there a way to get "add" to return a "timedata"
> object without having to copy the method verbatim from the "data" class
> to the "timedata" class? The functionality is exactly the same, so I
> really don't want to do that. Also, I can't dynamically define the
> class name for my call to obj_new because the init parameters are
> different.

Maybe I'm missing something, but if you want to copy the code
"verbatim", and the functionality is "exactly the same", can
it also be true that "the init parameters are different"!?
I'm confused. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: array of pointers inside a structure
Next Topic: Re: mosaic two images in direct graphics

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

Current Time: Fri Oct 10 08:56:53 PDT 2025

Total time taken to generate the page: 0.00185 seconds