Modules

A Module<T> is a specialized form of singleton used for many of Banshee's systems. Unlike standard singletons it requires manual startup and shutdown. To use it for your own objects, simply inherit from it and provide your own class as its template parameter.

class MyModule : public Module<MyModule>
{ };

Use Module<T>::startUp() to start it up. Once started use Module<T>::instance() to access its instance. Once done with it call Module<T>::shutDown() to release it.

MyModule::startUp();
MyModule::instance().doSomething();
MyModule::shutDown();