🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #13451

Re: Multiple Threads & One Text File

#13451
From: Remy Lebeau (TeamB)
Date: Mon, 13 Oct 2003 08:00
18 lines
1831 bytes
"dcent" <DcentJ8@NetScape.net> wrote in message
news:3F8A5437.8010207@NetScape.net...

> Is the constructor REALLY a private member, Gambit? :)

Yes, it is, actually.  One of the design features of a singleton is that
nobody outside of the class is allowed to create arbitrary instances of the
class except for itself.  If you look at the code more closely, you see that
the Instance() method is the only one creating the actual instance of the
class.  Since Instance() is a member of the class, it has access to the
private members, including the private constructor.  By making it private,
no code outside of the class can create their own instances.  That ensures
that all code outside of the class can only access the actual class instance
in a single manner, hense the name and design of a singleton class.


Gambit
Technical Details
Message-ID: <3f8a5b0e$3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f88f22a@newsgroups.borland.com> <3f890078$1@newsgroups.borland.com> <3F8A5437.8010207@NetScape.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,2cf03e35cbac1db7
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-10-13 01:09:05 PST
From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f88f22a@newsgroups.borland.com> <3f890078$1@newsgroups.borland.com> <3F8A5437.8010207@NetScape.net>
Subject: Re: Multiple Threads & One Text File
Date: Mon, 13 Oct 2003 01:00:12 -0700
Lines: 20
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 67.22.137.75
Message-ID: <3f8a5b0e$3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1066031886 67.22.137.75 (13 Oct 2003 00:58:06 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail