Boost logo

Boost Users :

Subject: [Boost-users] which library to use:cleaning up singletons
From: Littlefield, Tyler (tyler_at_[hidden])
Date: 2013-05-17 00:08:30


hello all:
I have a fairly large code base that has a lot of modules and systems.
The problem is that I have a main "engine" object that holds pointers to
a lot of created modules and components. I'm trying to find a more
dynamic way to do this, and I thought boost might be able to help. As a
result, I have a couple of questions.

First, I do a lot of manual adding of features. For example, when I add
a new command I have to add a engine->commands.AddCommand(new CMDFoo());
in an initialization method. Does boost provide some sort of mechenism
for dynamically handling this?

I also plan on splitting up the main "engine" object and setting up the
external modules as singletons. They act alone, but again I'd like to
dynamically initialize these. Is there a way on entry to dynamically
call specific singleton initialization methods, then at exit call their
release methods?
I'd like to be able to set some sort of trait on these objects at
compile-time that the runtime can use, or somehow generate the calls at
compile-time.
Thanks in advance for any info,

-- 
Take care,
Ty
http://tds-solutions.net
He that will not reason is a bigot; he that cannot reason is a fool; he that dares not reason is a slave.
Sent from my Toaster (tm).

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net