LokAccessorGroup¶
Inherits:
The LokAccessorGroup represents a collection of :ref:`LokStorageAccessor <LokStorageAccessor>`s.
Description¶
This class is the uppermost in the LokStorageManager hierarchy since it represents a general collection of LokStorageAccessor together, this class allows performing group operations, which trigger each accessors operations one after the other, and emits handy signals to know when the group operations started and finished. This is useful when it’s wanted to perform multiple operations on different save files, which can be indicated individually by each LokStorageAccessor.
Version: 1.0.0 Author: Daniel Sousa (github.com/nadjiel <github.com/nadjiel>_)
Property Index¶
Type |
Name |
Default value |
|---|---|---|
String |
|
|
:ref:`LokStorageAccessor <LokStorageAccessor>`[] |
|
Method Index¶
Signal Descriptions¶
group_saving_started()¶
The group_saving_started signal is emitted when a group of save operations was started by this LokAccessorGroup.
group_loading_started()¶
The group_loading_started signal is emitted when a group of load operations was started by this LokAccessorGroup.
group_removing_started()¶
The group_removing_started signal is emitted when a group of remove operations was started by this LokAccessorGroup.
group_saving_finished()¶
The group_saving_finished signal is emitted when a group of save operations was finished by this LokAccessorGroup.
group_loading_finished()¶
The group_loading_finished signal is emitted when a group of load operations was finished by this LokAccessorGroup.
group_removing_finished()¶
The group_removing_finished signal is emitted when a group of remove operations was finished by this LokAccessorGroup.
Property Descriptions¶
String current_version = ""¶
The current_version property is used as the version with which data is saved when using this LokAccessorGroup. By default, it is set to an empty String, which is converted to the latest available version.
LokStorageAccessor <LokStorageAccessor>`[] accessors = ``[]`¶
The accessors property is an Array responsible for storing all the LokStorageAccessor.
Method Descriptions¶
bool add_accessor(LokStorageAccessor accessor)¶
The add_accessor method is responsible for adding a new LokStorageAccessor to the accessors list, so that it can have its data manipulated together with the other ones.
bool remove_accessor(LokStorageAccessor accessor)¶
The remove_accessor method is responsible for removing a LokStorageAccessor from the accessors list, so that it doesn’t have its data manipulated by this LokAccessorGroup anymore.
void save_accessor_group(String version_number = current_version)¶
The save_accessor_group method is responsible for performing one save operation for each of the accessors in this LokAccessorGroup.
The start and finish of this group of operations is notified via the group_saving_started and group_saving_finished signals.
If it’s wanted, a version_number can be passed to dictate what version to use in this operation. In case none is provided, the current_version is used.
void load_accessor_group()¶
The load_accessor_group method is responsible for performing one load operation for each of the accessors in this LokAccessorGroup. The start and finish of this group of operations is notified via the group_loading_started and group_loading_finished signals.
void remove_accessor_group()¶
The remove_accessor_group method is responsible for performing one remove operation for each of the accessors in this LokAccessorGroup. The start and finish of this group of operations is notified via the group_removing_started and group_removing_finished signals.