Metaclass that ensures only one instance of a class exists (Singleton pattern)
◆ __call__()
| singleton.SingletonMeta.__call__ |
( |
| cls, |
|
|
* | args, |
|
|
** | kwargs ) |
Each time a class using this metaclass is instantiated, this method is called. It checks if an instance of the class already exists in the _instances dictionary:
- If no instance exists, it creates a new one by calling the superclass __call__, stores it in _instances, and returns it
- If an instance already exists, it returns the stored instance instead of creating a new one
The documentation for this class was generated from the following file:
- /home/ymahe/Desktop/StrokeSeg/StrokeSegLab/managers/singleton.py