~ubuntu-branches/ubuntu/maverick/ultrastar-ng/maverick

« back to all changes in this revision

Viewing changes to include/singleton.h

  • Committer: Bazaar Package Importer
  • Author(s): Miriam Ruiz, Miriam Ruiz, Mario Bonino, Jon Dowland, Ansgar Burchardt
  • Date: 2008-06-07 16:43:18 UTC
  • mfrom: (4.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080607164318-4cnzizck1tp8mrwp
Tags: 0.2.1-1
[ Miriam Ruiz ]
* New Upstream Release (Closes: #453132)
* Removed unneeded patches
* Added packages to build deps:
  + libtool
  + portaudio19-dev | portaudio-dev
  + libboost-dev, libboost-thread-dev, libboost-serialization-dev
  + libboost-program-options-dev, libboost-regex-dev
* Moved shared objects to private directory: /usr/lib/ultraster-ng
* Added rpath to binaries to search for shared objects in the private dir
* Uses ultrastar-ng-gstreamer as default, instead of ultrastar-ng-xine,
  since there are significantly less issues with GStreamer.
* Added patch to fix upstream desktop file
* Added -Wl,-as-needed to LDFLAGS
* Replaced fftw3-dev by libfftw3-dev in build dependencies.
* Standards-Version upgraded to 3.7.3

[ Mario Bonino ]
* Fixed data/Makefile.am to install .desktop file and icon

[ Jon Dowland ]
* add Homepage: control field to source stanza
* fix a bashism in debian/rules (Closes: #478634)

[ Ansgar Burchardt ]
* debian/control: Change XS-Vcs-* to Vcs-*
* Remove Homepage semi-field from description

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef __SINGLETON_H__
2
2
#define __SINGLETON_H__
3
3
 
4
 
#include "../config.h"
5
 
 
6
4
template <class T> class CSingleton {
7
 
        protected:
 
5
  protected:
8
6
        static T* ms_CSingleton;
9
 
        public:
10
 
        CSingleton(void) { ms_CSingleton = static_cast<T*>(this); }
11
 
        ~CSingleton(void) { ms_CSingleton = NULL; }
12
 
        inline static T& getSingleton(void) { return *ms_CSingleton; }
13
 
        inline static T* getSingletonPtr(void) { return ms_CSingleton; }
 
7
  public:
 
8
        CSingleton() { ms_CSingleton = static_cast<T*>(this); }
 
9
        ~CSingleton() { ms_CSingleton = 0; }
 
10
        inline static T& getSingleton() { return *ms_CSingleton; }
 
11
        inline static T* getSingletonPtr() { return ms_CSingleton; }
14
12
};
15
13
 
16
14
#endif