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

Home » Public Forums » archive » Puzzling over inherited objects
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
Puzzling over inherited objects [message #84572] Tue, 04 June 2013 14:51
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
I'm quite new to using objects and wanted to do a bit more with what I have been doing until now (not much anyway...). So here is the deal.
I want to create an object that incorporates (inherits?) the a typical object such as IDLanROI. So that the structure definition would look like this something like this:

class = {MyRoiObj, INHERITS IDLanROI, IDNr:0L}

where I simply added an ID to each IDLanROI. I still want to have all the functionality of the methods associated with IDLanROI.

The problem is: how would I assign the object (properties of) IDLanROI to my new object in the init function? I guess (and I'm quite sure) that something like
self = obj_new('IDLanROI')
or
void = obj_new('IDLanROI')
struct_assign, self, void

will not work. So the only solution I see at the moment is to create the structure as:

class = {MyRoiObj, IDLanROI_ref:OBJ_NEW(), IDNr:0L}

And then in the init or whereelse, assign the object as:
self.IDLanROI_ref = obj_new('IDLanROI')

So here is the question... is there a better way to do this? Ideally objects are made with inheritance... I simply can't find a way to use that in my case.

Any suggestions?

Thanks,
Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to convert 16-bit science data recorded as AVI files into 16-bit images ?
Next Topic: upsampling images

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

Current Time: Wed Oct 08 13:55:18 PDT 2025

Total time taken to generate the page: 0.00512 seconds