Public Member Functions | |
| def | __init__ |
| def | save_new_state |
| def | get_current_state |
| def | get_prev_state |
| def | get_next_state |
| def | update_actions |
Public Attributes | |
| states | |
| current_state_index | |
| num_prev_states | |
| num_next_states | |
The state cache is an interface to a list to record data/states and to revert to previous states. States are recorded into the list in a circular fassion by using an index for the current state, and counters for the range where states are stored.
Definition at line 27 of file StateCache.py.
| def grc.StateCache.StateCache.__init__ | ( | self, | ||
| initial_state | ||||
| ) |
StateCache constructor.
| initial_state | the intial state (nested data) |
Definition at line 34 of file StateCache.py.
| def grc.StateCache.StateCache.save_new_state | ( | self, | ||
| state | ||||
| ) |
Save a new state. Place the new state at the next index and add one to the number of previous states.
| state | the new state |
Definition at line 46 of file StateCache.py.
| def grc.StateCache.StateCache.get_current_state | ( | self | ) |
Get the state at the current index.
Definition at line 59 of file StateCache.py.
| def grc.StateCache.StateCache.get_prev_state | ( | self | ) |
Get the previous state and decrement the current index.
Definition at line 67 of file StateCache.py.
| def grc.StateCache.StateCache.get_next_state | ( | self | ) |
Get the nest state and increment the current index.
Definition at line 79 of file StateCache.py.
| def grc.StateCache.StateCache.update_actions | ( | self | ) |
Update the undo and redo actions based on the number of next and prev states.
Definition at line 91 of file StateCache.py.
Definition at line 39 of file StateCache.py.
Definition at line 40 of file StateCache.py.
Definition at line 41 of file StateCache.py.
Definition at line 42 of file StateCache.py.
1.5.4