utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
utility::Singleton< Type > Class Template Reference

Singleton class template. More...

#include <headers/utility/singleton.hpp>

Public Member Functions

 Singleton (const Singleton &)=delete
 
Singletonoperator= (const Singleton &)=delete
 

Static Public Member Functions

static Type & getInstance (void)
 Get the singleton instance.
 

Detailed Description

template<CanBeSingleton Type>
class utility::Singleton< Type >

Singleton class template.

This class provides a thread-safe implementation of the singleton design pattern. It ensures that only one instance of the class is created and provides global access to it.

Template Parameters
TypeThe type of the singleton class.

Definition at line 47 of file singleton.hpp.

Member Function Documentation

◆ getInstance()

template<CanBeSingleton Type>
static Type & utility::Singleton< Type >::getInstance ( void  )
inlinestatic

Get the singleton instance.

This method returns a shared pointer to the singleton instance. If the instance does not exist, it is created.

Returns
A reference to the singleton instance.

Definition at line 62 of file singleton.hpp.


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