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

Home » Public Forums » archive » syntax for calling parent class _overloadPlus method
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: syntax for calling parent class _overloadPlus method [message #93113 is a reply to message #93105] Thu, 28 April 2016 13:35 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/28/16 7:01 AM, Markus Schmassmann wrote:
> i'm trying to overload operators for my subclass of idl_variable, but
> don't find the correct syntax for calling the parent classes' operator
> function.
>
> How do i have to correct the line below marked ';problem' without using
> 'left+right'?
> i guess i have to put something like XXX.idl_variable::_overload...
> but what would then be XXX?
>
> ---
> pro sandbox__define
> struct={sandbox, $
> inherits idl_variable, $
> reps: ptr_new() $
> }
> end
>
> function sandbox::Init, array, reps
> ; a bit of code
> void=self.idl_variable::init()
> void=self.idl_variable::set_value(array)
> *self.reps=reps
> return, 1
> end
>
> function sandbox::_overloadPlus, left, right
> ; some code
> out=idl_variable::_overloadPlus(left,right) ;problem
> ; some more code
> return, out
> end
> ---
>
> PS: Sorry, stupid question of a beginner, but i failed to find the
> solution elsewhere.
> PPS: There may be more errors, but the rest at least compiles.

In general, you would use something like the following to call a
parent's implementation:

out = self->IDL_Variable::overloadPlus(left, right)

You can use the . notation you used in ::init as well:

out = self.IDL_Variable::overloadPlus(left, right)

But, in your case, you are calling some methods that don't exist. As
far as I can tell, there are no IDL_Variable::init,
IDL_Variable::set_value, and IDL_Variable::_overloadPlus methods.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Very basic IDL vector question
Next Topic: Wrong documentation for BitGet()?

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

Current Time: Wed Oct 08 15:59:26 PDT 2025

Total time taken to generate the page: 0.00467 seconds