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

Home » Public Forums » archive » Object Data and pointer assignments
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Object Data and pointer assignments [message #19320] Thu, 09 March 2000 00:00 Go to previous message
Ben Tupper is currently offline  Ben Tupper
Messages: 186
Registered: August 1999
Senior Member
Hello,

I am in the middle of wrtting my first object from scratch. Scratch is
a good word since I'm doing a lot of that on my head. I'm hoping to get
some advice on organization of data. I need 4 pieces of data (one 2d
arrays and two structures that vary in size according to the size of the
arrays) plus six keywords that I need to get/set. Currently, I have
defined each of the 3 bits of data as null pointers in the BLAH__DEFINE
procedure.

In the BLAH::INIT function, the user passes one of the two arrays as an
argument. At that point I reassign one of the pointers to...

Self.InArray = Ptr_New(InArray).

I think I understand why I can reassign the structure field when going
from a null pointer to a filled pointer. On second thought, I don't
understand it but I can accept that it works. It's the next step I need
help on.

I would like to change the contents of this field later to some other
value (a differently sized array.) Here's where the ice under me gets
very very thin and my eyes get misty. In the BLAH::SETPROPERTY method,
I don't know if I should free this pointer before reassigning (and does
that leave the structure field undefined?), or if I should simply
overwrite it as I did in the INIT function. If I reassign the filed
to a new pointer, what happens to the previously occupied heap space?
Have I sprung a leak?

Thanks!

Ben


--
Ben Tupper

Bigelow Laboratory for Ocean Science
tupper@seadas.bigelow.org

pemaquidriver@tidewater.net
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: New Wavelets option
Next Topic: Re: Almost dead widgets

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

Current Time: Fri Oct 10 09:31:48 PDT 2025

Total time taken to generate the page: 0.80166 seconds