hpcflow.sdk.app.Singleton#

class hpcflow.sdk.app.Singleton#

Bases: type, Generic[T]

Metaclass that enforces that only one instance of a class can be made.

Type Parameters#

T

The type of the class that is a singleton.

Methods

get_instance

Retrieve the instance of the singleton class if initialised.

mro

Return a type's method resolution order.

get_instance()#

Retrieve the instance of the singleton class if initialised.

Raises:

RuntimeError – If there is no instance already.

Parameters:

cls (Singleton[T]) –

Return type:

T

mro()#

Return a type’s method resolution order.