restrict the creation of an object

From: greymatter (greymatter_at_nospam.com)
Date: 03/26/04


Date: Thu, 25 Mar 2004 23:48:05 GMT

Hi, would anyone know how to restrict the creation of an object. Lets say
that code specification required a maximum of 10 objects created at any one
time. I know that a static variable in a class could keep count of the
number of objects of any one kind created. But how can i tell the code not
to create more than 10 objects. So for example if my main() tried to create
an 11th object, the code would return with "Sorry, not possible to create
object". I dont understand how to do this.

Any help appreciated!
thanks
grey



Relevant Pages

  • Re: OT: Wisdom in our Leaders
    ... Whatever value you bring to a fly fishing group is strictly ... So long as you restrict your postings ... I still dont like queers. ...
    (rec.outdoors.fishing.fly)
  • Re: aquiring instances references
    ... I have a design decision issue, dont know why its an issue, except that its OO, so I am not sure what is the best way. ... 1- static creation. ... I personally like 3 the best, with the addition of using an application container (such as Guice or Spring). ... class ApplicationManager { ...
    (comp.lang.java.help)
  • Re: If anyones interested in homebrew customs...
    ... or show a one off creation for a few shots among the gun head ... Since my friend mentioned it, I originally named it Mr. Rogers, and wanted colors to match--dark grey and dark red. ... And the paint you're thinking about is probably 'Mirage' or 'Chameleon' paint. ...
    (rec.sport.paintball)
  • Re: restrict the creation of an object
    ... would anyone know how to restrict the creation of an object. ... "More Effective C++" book by Scott Meyers. ... objects in the program and throw an exception out of constructor if ...
    (comp.lang.cpp)
  • Restricting the creation of sites using templates
    ... We are creating site definitions and one of the requirements we have is ... to restrict the available type of sites for creation for a certain ... template. ...
    (microsoft.public.sharepoint.portalserver.development)

Loading