Shaka Player Embedded
Classes | Public Member Functions | Static Public Member Functions | List of all members
shaka::PseudoSingleton< T > Class Template Reference

#include <pseudo_singleton.h>

Classes

struct  UnsetForTesting
 

Public Member Functions

 PseudoSingleton ()
 
 ~PseudoSingleton ()
 

Static Public Member Functions

static T * Instance ()
 
static T * InstanceOrNull ()
 

Detailed Description

template<typename T>
class shaka::PseudoSingleton< T >

A base class for types that should only have one instance at a time. This defines a static method to get the instance that will be inherited to the type. This type is fully thread-safe and can be used on any thread.

The type argument should be the type itself. For example:

class Foo : public PseudoSingleton<Foo> {};

Definition at line 37 of file pseudo_singleton.h.

Constructor & Destructor Documentation

§ PseudoSingleton()

template<typename T>
shaka::PseudoSingleton< T >::PseudoSingleton ( )
inline

Definition at line 61 of file pseudo_singleton.h.

§ ~PseudoSingleton()

template<typename T>
shaka::PseudoSingleton< T >::~PseudoSingleton ( )
inline

Definition at line 67 of file pseudo_singleton.h.

Member Function Documentation

§ Instance()

template<typename T>
static T* shaka::PseudoSingleton< T >::Instance ( )
inlinestatic

Definition at line 73 of file pseudo_singleton.h.

§ InstanceOrNull()

template<typename T>
static T* shaka::PseudoSingleton< T >::InstanceOrNull ( )
inlinestatic

Definition at line 79 of file pseudo_singleton.h.


The documentation for this class was generated from the following file: