cache module¶
-
class
cache.
Cache
¶ Bases:
object
This class acts as a cache of
SetOfCims
objects for a node.- _list_of_sets_of_parents
a list of
Sets
objects of the parents to which the cim in cache at SAME index is related- _actual_cache
a list of setOfCims objects
-
clear
() → None¶ Clear the contents both of
_actual_cache
and_list_of_sets_of_parents
.
-
find
(parents_comb: Set) → set_of_cims.SetOfCims¶ Tries to find in cache given the symbolic parents combination
parents_comb
theSetOfCims
related to thatparents_comb
.- Parameters
parents_comb (Set) – the parents related to that
SetOfCims
- Returns
A
SetOfCims
object if theparents_comb
index is found in_list_of_sets_of_parents
. None otherwise.- Return type
-
put
(parents_comb: Set, socim: set_of_cims.SetOfCims) → None¶ Place in cache the
SetOfCims
object, and the related symbolic indexparents_comb
in_list_of_sets_of_parents
.- Parameters
parents_comb (Set) – the symbolic set index
socim (SetOfCims) – the related SetOfCims object