Acheron
Loading...
Searching...
No Matches
acheron::ecs::SingletonStorage< T > Class Template Reference

Interal storage wrapper for singletons. More...

#include <singleton.hpp>

Static Public Member Functions

static void Set (const T &value)
 Initializes singleton and sets the instance value.
static T & Get ()
 Get the instance of a singleton.
static bool IsSet ()
 Check if the singleton is set.

Detailed Description

template<typename T>
class acheron::ecs::SingletonStorage< T >

Interal storage wrapper for singletons.

Template Parameters
Thetype of the singleton

Member Function Documentation

◆ Get()

template<typename T>
T & acheron::ecs::SingletonStorage< T >::Get ( )
inlinestatic

Get the instance of a singleton.

Returns
Reference to the singleton instance
Exceptions
AssertFail if the singleton isnt set

◆ IsSet()

template<typename T>
bool acheron::ecs::SingletonStorage< T >::IsSet ( )
inlinestatic

Check if the singleton is set.

Returns
A bool for if the singleton has been set or not

◆ Set()

template<typename T>
void acheron::ecs::SingletonStorage< T >::Set ( const T & value)
inlinestatic

Initializes singleton and sets the instance value.

Parameters
valueThe value of the singleton

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