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

Home » Public Forums » archive » Re: Are user-defined private methods possible?
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: Are user-defined private methods possible? [message #67172] Fri, 10 July 2009 01:33 Go to previous message
Oliver is currently offline  Oliver
Messages: 6
Registered: July 2009
Junior Member
cool - I'm always amazed about the creativity of people when it comes
to circumvent all those IDL annoyances.

For my lib I used the much simpler approach of defining a 'magic'
number, something along the lines of

pro myClass::privateMethod, arg1, arg2, magic
if( magic ne 148 ) then message, 'private calls only...'
; ...
end

This is obviously no protection at all against someone who on purpose
wants
to call this method, but then its his/her own fault and I would
consider this
bad style and a programming error.

Speaking about mimicking OO concepts in IDL: what also annoys me is
the absence of static methods and class variables.
For the former I use the convention

pro myClass_staticMethodName

i.e. by mixing "classic" IDL and object orientation. Ugly but it
works.
For the latter I use commons:

common myClassStaticVars initializedFlag, var1, var2, var3

The problem with this approach is that variables cannot be initialized
here.
So I define a method

pro myClass_initializeStaticVars

which I either call at program start or (if there're not too many)
in the constructor and all 'static methods' of the class.
InitializedFlag
is set to '1' during the first call so repeated calls have no effect.

Cheers
Oliver
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: nike clothing,nike shoes,online store,http://www.nbashoe.com air Jordan Shoes,Nike Air Jordans, Air Force Ones,Retro Air Jordan, Bape Hoodies,Bape shoes-Tencent Traveler|Jordan Shoes,Nike Air Jordans, Air Force Ones,Retro Air Jordan, Bape Hoodie
Next Topic: Re: Question about user input in IDL

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

Current Time: Sat Oct 11 04:09:19 PDT 2025

Total time taken to generate the page: 1.40691 seconds