How to create multiple instances of a static members?

Eike Welk eike.welk at post.rwth-aachen.de
Sat Feb 11 12:42:32 GMT 2006


On Saturday 11 February 2006 07:34, kitts wrote:
> Hi All,
>
> I am new to developing in KDE and don't have much experience with
> C++ itself, so please excuse my naiveness.
>
> I would like to know how i can create multiple instances of a class
> which has static members, such that the static members too are
> instantiated?
>
> My program is structured as a trees of objects. The objects within
> each tree are allowed to instantiate the special class. However, i
> want the static objects of this special class to be instantiated
> only once for each tree.
>
> I also have a static slot fucntion which i want to "connect" to
> when the first instance in a given tree is created.
>
> How do i approach this situation?

What about a separate root class for the trees? The root object of 
each tree contains the "special" object (that you wanted to be 
static). The other nodes in the tree contain pointers to the 
"special" object.

HTH Eike.


-
to unsubscribe from this list send an email to kdevelop-request at kdevelop.org with the following body:
unsubscribe »your-email-address«



More information about the KDevelop mailing list