StrokeSegLab
Loading...
Searching...
No Matches
option_manager.Option Class Reference
Inheritance diagram for option_manager.Option:

Public Member Functions

None __init__ (self)
 
get (self, str key, T default=None)
 
None set (self, str key, T value)
 

Protected Attributes

dict _options = {}
 

Detailed Description

Singleton class to manage application option with a dictionnary.
Options are execution parameters that change with each run (input path, save probability map, ...)

Args:
    metaclass (_type_, optional): The metaclass controls the creation of the class itself. Defaults to SingletonMeta, which makes sure only one object of the class is ever created (singleton pattern)

Constructor & Destructor Documentation

◆ __init__()

None option_manager.Option.__init__ ( self)
Initialize the option class with just a dictionnary

Member Function Documentation

◆ get()

T option_manager.Option.get ( self,
str key,
T default = None )
Get the value for a key

Args:
    key (str): Key name
    default (T, optional): Value to return if the key doesn't exist. Defaults to None

Returns:
    T: Return value corresponding to the key

◆ set()

None option_manager.Option.set ( self,
str key,
T value )
Set or add a value for a key

Args:
    key (str): Key name
    value (T): Value corresponding to the key

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