Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

syn::Singleton Class Template Reference

You can use this coolio class to make a singleton, just inherit like so... More...

#include <Singleton.h>

Inheritance diagram for syn::Singleton:

Inheritance graph
[legend]
List of all members.

Static Public Methods

singleClass* instance (void)
 Use the macro from above... More...


Protected Methods

 Singleton ()
 Don't create a singleton with new! use instance(). More...

virtual ~Singleton ()
 don't delete a singleton! More...


Detailed Description

template<class singleClass> class syn::Singleton

You can use this coolio class to make a singleton, just inherit like so...

class myClass : public vpr::Singleton<myClass>

Definition at line 16 of file Singleton.h.


Constructor & Destructor Documentation

template<class singleClass>
syn::Singleton<singleClass>::Singleton<singleClass> ( ) [inline, protected]
 

Don't create a singleton with new! use instance().

Definition at line 53 of file Singleton.h.

template<class singleClass>
syn::Singleton<singleClass>::~Singleton<singleClass> ( ) [inline, protected, virtual]
 

don't delete a singleton!

Definition at line 58 of file Singleton.h.


Member Function Documentation

template<class singleClass>
singleClass * syn::Singleton<singleClass>::instance ( void ) [inline, static]
 

Use the macro from above...

kludgy yeah, but... NOTE: it might not be good to have the imp inline in the header???
NOTE: currently, func is thread safe after first call to instance(). if first call to instance happens multiple times simultaneously then don't be surprised when something dies because of a mutex.. this bug can be caused by spawning two threads immediately after entering main()

Definition at line 29 of file Singleton.h.


The documentation for this class was generated from the following file:
Generated at Mon Apr 15 09:28:07 2002 for subsynth by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001