Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Single instance of class with specific parameter

9 views
Skip to first unread message

tzvikaz

unread,
Mar 23, 2009, 6:50:32 PM3/23/09
to
Hi,
Let's say I have a class called MyClass and it has a memebr called
iType;
now every time i create an object I pass the iType in the constructor.
I want to be able to create a new object only if an object with the
same iType does not exist.

What's the best practice to do it?

In other languages I could use a static vector member that will hold
this info and have the constructor private.
But there is no static class member in Delphi and Im not sure thats
the right approach anyways.

0 new messages