Boost logo

Boost :

From: Jody Hagins (jody-boost-011304_at_[hidden])
Date: 2005-01-11 18:10:59


On Tue, 11 Jan 2005 22:30:42 +0530
"Mithun R K" <mithun.radhakrishnan_at_[hidden]> wrote:

> 1. Have a single SingletonRegistry that would keep pointers to all
> Singleton instances (well, actually, SingletonBase instances.
> SingletonBase is not a class-template.)

Sorry for interloping here, but I think boost already provides several
mechinisms for doing the same thing without requiring the inheritance
hierarchy. For example, you could register boost::function<> objects to
create/destroy, or you could require registry as boost::shared_ptr<
Whatever >, and store boost::shared_ptr< void >, which already knows how
to properly destroy itself, or ...

I have not thought too much about your other issues, but you may want to
take a look at ACE, and the ACE_Object_Manager (or something like that).
 It manages objects, and I believe it hooks atexit() to do other
destructions. Of course, there are pros/cons to this approach as well,
but it is there to look at...


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk