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
Need advice about inheritance [message #44098] Sat, 21 May 2005 08:03 Go to previous message
wcramer is currently offline  wcramer
Messages: 9
Registered: February 2005
Junior Member
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.

Any advice would be greatly appreciated.

Thanks,
Doug
[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 05:20:54 PDT 2025

Total time taken to generate the page: 0.16195 seconds