fifo — Camelot documentation

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- view »

# 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)

  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)

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

  `delete_by_entity`(entity)

    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)

    Remove the data and the reference to the object at row

  `get_data_at_row`(row)

    Returns: | the data at row

  `get_entity_at_row`(row)

    Returns: | the entity that is stored at a row

  `get_row_by_entity`(entity)

    Returns: | the row at which an entity is stored

  `has_data_at_row`(row)

    Returns: | True if there is data in the cache for the row, False if

    there isn’t

  `rows`()

    Returns: | a interator of the row numbers for which this fifo

    had data

  `shallow_copy`(max_entries)

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

### Navigation

- index
- modules |
- next |
- previous |
- Camelot documentation »
- Camelot API »
- view »

Comments
blog comments powered by Disqus