grc.StateCache.StateCache Class Reference

List of all members.

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


Detailed Description

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.


Member Function Documentation

def grc.StateCache.StateCache.__init__ (   self,
  initial_state 
)

StateCache constructor.

Parameters:
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.

Parameters:
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.

Returns:
the current state (nested data)

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.

Returns:
the previous state or None

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.

Returns:
the next state or None

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.


Member Data Documentation

grc.StateCache.StateCache.states

Definition at line 39 of file StateCache.py.

grc.StateCache.StateCache.current_state_index

Definition at line 40 of file StateCache.py.

grc.StateCache.StateCache.num_prev_states

Definition at line 41 of file StateCache.py.

grc.StateCache.StateCache.num_next_states

Definition at line 42 of file StateCache.py.


The documentation for this class was generated from the following file:
Generated on Sat Aug 23 02:00:12 2008 for GNU Radio Companion by  doxygen 1.5.4