I can clearly see your points,
it's not like if there is a lot of objects, hard initializtion order,
etc ... but I agree with you (even if Logger, Preferences AudioEngine are
good candidates for singleton pattern has described in your ref [1] ;).
the more natural way for me would be :
class Hydrogen {
void bootstrap() {
AudioEngine *ae = new AudioEngine();
...
}
void shutdown () {
delete ae;
...
}
AudioEngine* audio_engine() { return ae; }
}
and to be sure that nobody mess object initialization.
static AudioEngine::__inst=0;
AudioEngine() {
assert(__inst==0);
__inst=1;
....
}
it's not thread safe ... but strong enough to prevent bad usage.
about the logger thread, I forgot that H2 is about realtime
audio processing, shame on me.
following the previous, it could be an idea to get rid of QString usage within
the
core library ... ok stop me.
Jeremy
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel