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

Home » Public Forums » archive » Copying an object
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: Copying an object [message #17074 is a reply to message #17025] Fri, 03 September 1999 00:00 Go to previous message
steinhh is currently offline  steinhh
Messages: 260
Registered: June 1994
Senior Member
Since the documentation for STRUCT_ASSIGN in 5.2.1 says
that both destination and source may be an object reference
when used inside an object method, the only "problem" is to make an
uninitialized instance of the object (like val = {STRUCT_NAME}).
But this could easily be implemented in an object's init method,
thus:

FUNCTION BLAH::INIT,....,CLONE=CLONE

IF OBJ_VALID(CLONE) THEN BEGIN
IF NOT OBJ_CLASS(CLONE) EQ OBJ_CLASS(SELF) THEN ... ;ERROR
STRUCT_ASSIGN,CLONE,SELF
RETURN,1
END
:
: ;; Non-clone initialization code
END

which would be called like this:

clone = OBJ_NEW('BLAH',CLONE=ORIGINAL)

Of course, this doesn't deal with issues of "parents" or other
pointers to the cloned objects. But this will have to be dealt
with for each specific type of object.

Regards,

Stein Vidar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL demo during Seybold SF keynote
Next Topic: Re: Last version of IDL supported on VAX/VMS?

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

Current Time: Sat Oct 11 05:22:48 PDT 2025

Total time taken to generate the page: 1.04281 seconds