113 template <
class K>
class Deleter
117 ~Deleter() {
if (guarded)
delete guarded; }
130 static Deleter<std::shared_ptr<T> >
instance;
144 if (!instance.guarded)
148 instance.guarded =
new std::shared_ptr<T>(quick);
150 return *(instance.guarded);
193 #define XBMC_GLOBAL_REF(classname,g_variable) \ 194 static std::shared_ptr<classname> g_variable##Ref(xbmcutil::GlobalsSingleton<classname>::getInstance()) 202 #define XBMC_GLOBAL_USE(classname) (*(xbmcutil::GlobalsSingleton<classname>::getQuick())) static std::shared_ptr< T > getInstance()
Retrieve an instance of the singleton using a shared pointer for reference counting.
Definition: GlobalsHandling.h:142
This is another bit of hackery that will act as a flag for whether or not a global/static has been in...
Definition: GlobalsHandling.h:179
Definition: addon_base.h:267
This file contains the pattern for moving "globals" from the BSS Segment to the heap.
Definition: GlobalsHandling.h:86
static T * getQuick()
This is for quick access when using form (2) of the pattern.
Definition: GlobalsHandling.h:160
This class is an implementation detail of the macros defined below and is NOT meant to be used as a g...
Definition: GlobalsHandling.h:105