fifo

Module containing the FIFO cache used in the collection proxy to store the data that is passed between the model and the gui thread

class camelot.view.fifo.Fifo(max_entries)[source]

Fifo, is the actual cache containing a limited set of copies of row data so the data in Fifo, is always immediately accessible to the gui thread, with zero delay as you scroll down the table view, Fifo is filled and refilled with data queried from the database

the cache can be queried either by the row number or by object represented by the row data.

add_data(row, entity, value)[source]

The entity might already be on another row, and this row might already contain an entity

Returns:a set with all the changed columns in the row
delete_by_entity(entity)[source]

Remove everything in the cache related to an entity instance returns the row at which the data was stored if the data was in the cache, return None otherwise

delete_by_row(row)[source]

Remove the data and the reference to the object at row

get_data_at_row(row)[source]
Returns:the data at row
get_entity_at_row(row)[source]
Returns:the entity that is stored at a row
get_row_by_entity(entity)[source]
Returns:the row at which an entity is stored
has_data_at_row(row)[source]
Returns:True if there is data in the cache for the row, False if

there isn’t

rows()[source]
Returns:a interator of the row numbers for which this fifo

had data

shallow_copy(max_entries)[source]

Copy the cache without the actual data but with the references to which object is stored in which row