The Kernel class is the core of the system.
It is instantiated once at the beginning of the program and then gathers every handleable object in different lists, in order to make them accessible by other parts of the program (such as the User Interface):
Variables: |
|
---|
Adds the element given as argument to the corresponding objects list of the kernel.
It auto-detects the type of the argument given and automatically appends to one of the lists of the kernel.
Parameters: | element (models.Information or models.Action or models.Device or models.Interface or models.Protocol or models.Driver or scenario.Scenario or models.BlockModel) – The element to add to the kernel |
---|---|
Raises TypeError: | |
if the element given as argument is of none of the types given above. |
Get an element previously added to the kernel by providing its id.
Parameters: | searched_id (int) – The ID of the element which is searched. |
---|---|
Returns: | the searched object or False if it has not been found |
Return type: | int or bool |
(Internal) Get an identifier that we know being unique. It is used by the add_to_kernel() so that any object added to the kernel gets its own identifier.
It is particularly useful when it comes to user interfaces.
Returns: | A unique identifier |
---|---|
Return type: | int |
Loads all plugins available in the plugin package/subdirectory. If a plugin has already been loaded, it is ignored.
Remove the element whose ID has been given as argument from the kernel and returns it.
Parameters: | searched_id (int) – The ID of the element to remove |
---|---|
Returns: | The removed element or false |
Return type: | models.Information or models.Action or models.Device or models.Interface or models.Protocol or models.Driver or scenario.Scenario or models.BlockModel or boolean |