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

Home » Public Forums » archive » Re: singleton usage
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: singleton usage [message #47611 is a reply to message #47610] Tue, 21 February 2006 05:58 Go to previous message
Antonio Santiago is currently offline  Antonio Santiago
Messages: 201
Registered: February 2004
Senior Member
vcarlos wrote:
> Hi all,
>
> maybe it is the dumbiest question of all time about singleton, but
> since I am in doubt, is better ask thank keep it :)
>
> When you define a singleton object, everywhere in the program you use
> it you must call something like this: myObject = Obj_New('Singleton'),
> and then myObject will point to the same instance created before. That
> is fine to me, but what I have doubt is about the usage of this feature
> in my program, since everytime I want access that object I will need to
> write the same statement above, or set an attribute in a class to point
> to the singleton instance, right?
>
> What if, instead of doing that, I create an read only system variable
> holding the object that I want use over the program?
>
One of posible implementations of a Singleton in IDL uses a system
variable to hold the object reference. Other solution uses a common block.

> I know I lost some features, but is not it more useful?
>
> Well, that is it. Thanks
>
> (sorry about my english)
>
> Vinicius
>


--
-----------------------------------------------------
Antonio Santiago P�rez
( email: santiago<<at>>grahi.upc.edu )
( www: http://www.grahi.upc.edu/santiago )
( www: http://asantiago.blogsite.org )
-----------------------------------------------------
GRAHI - Grup de Recerca Aplicada en Hidrometeorologia
Universitat Polit�cnica de Catalunya
-----------------------------------------------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL Graphics Objects & Heap Variables
Next Topic: Adding a GEOTIFF header to a (large) TIF file

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

Current Time: Thu Oct 09 02:48:11 PDT 2025

Total time taken to generate the page: 0.56050 seconds