11 // Store rendered elements from files but not the files.
12 // Drawing caches must be separate from file caches to avoid
13 // delaying other file accesses for the drawing routines.
16 class CacheItemBase
: public ListItem
<CacheItemBase
>
20 virtual ~CacheItemBase();
24 virtual int get_size();
26 // asset_id - supplied by user if the cache is not part of a file.
27 // Used for fast accesses.
29 // path is needed since the item may need to be deleted based on file.
32 // Number of last get or put operation involving this object.
34 // Starting point of item in asset's native rate.
40 class CacheBase
: public List
<CacheItemBase
>
50 // Remove all items with the asset id.
51 void remove_asset(Asset_GC asset
);
53 // Insert item in list in ascending position order.
54 void put_item(CacheItemBase
*item
);
56 // Get first item from list with matching position or 0 if none found.
57 CacheItemBase
* get_item(int64_t position
);
59 // Called when done with the item returned by get_.
60 // Ignore if item was 0.
63 // Get ID of oldest member.
64 // Called by MWindow::age_caches.
67 // Delete oldest item. Return 0 if successful. Return 1 if nothing to delete.
70 // Calculate current size of cache in bytes
71 int64_t get_memory_usage();
74 // Current position of search
75 CacheItemBase
*current_item
;
84 // c-file-style: "linux"