home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!utcsri!geac!censor!animal!ralph
- From: ralph@yo_dud.bell.ca (Ralph Doncaster)
- Subject: semi-private public methods?
- Message-ID: <RALPH.93Jan11143011@yo_dud.bell.ca>
- Sender: news@animal.er.bell.ca
- Reply-To: ralph@dci.pinetree.org
- Organization: /home/yo_dud/ralph/.organization
- Distribution: na
- Date: Mon, 11 Jan 1993 19:30:11 GMT
- Lines: 16
-
- I would like to have a class that has some public methods that can
- only be used by a certain group of classes.
- Lets call this class A, and I want B,C,D &E to be able to use the
- public methods on A. (no problem so far)
- However, I don't want classes X, Y, &Z to be able to use the methods,
- nor any other similar classes added in the future.
- I don't want B,C,D &E to access the private data of A, so I can't make
- them friend classes. A,B,C,D, &E aren't in the same heirarchy, so I
- can't use inheritance to have a solution to the problem.
- What I would like to be able to do is say that the public methods of A
- are only public to a certain group of classes, and private to all
- others.
- Any ideas?
-
- post, or reply to ralph@dci.pinetree.org
-
-