Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
SingletonPtr< T > Struct Template Reference

Utility class for creating an using a singleton. More...

#include <SingletonPtr.h>

Public Member Functions

T * get () const
 Get a pointer to the underlying singleton. More...
 
T * operator-> () const
 Get a pointer to the underlying singleton. More...
 
T & operator* () const
 Get a reference to the underlying singleton. More...
 

Detailed Description

template<class T>
struct SingletonPtr< T >

Utility class for creating an using a singleton.

Note
Synchronization level: Thread safe
: This class must only be used in a static context - this class must never be allocated or created on the stack.
: This class is lazily initialized on first use. This class is a POD type so if it is not used it will be garbage collected.

Definition at line 87 of file SingletonPtr.h.

Member Function Documentation

T* get ( ) const

Get a pointer to the underlying singleton.

Returns
A pointer to the singleton

Definition at line 94 of file SingletonPtr.h.

T& operator* ( ) const

Get a reference to the underlying singleton.

Returns
A reference to the singleton

Definition at line 127 of file SingletonPtr.h.

T* operator-> ( ) const

Get a pointer to the underlying singleton.

Returns
A pointer to the singleton

Definition at line 117 of file SingletonPtr.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.