Skip to main content
ATL Server Library Reference 
Cache Flusher Archetype 

Classes that conform to the cache flusher archetype can be used to determine whether, and in what order, items should be removed from a CMemoryCacheBase-derived cache using the number and sequence of accesses as the basis for making the decision.

Implementation

To implement a class conforming to this archetype, the class must provide the following methods:

Method Description

Access

Called by the cache when the reference count of an item is incremented.

Add

Called by the cache when a new item has been added to the cache.

GetNext

Called by the cache when scanning for items that can be removed from the cache.

GetStart

Called by the cache to get the first item that can be removed from the cache.

Release

Called by the cache when the reference count of an item is decremented.

Remove

Called by the cache when an item has been removed from the cache.

Existing Implementations

These classes conform to this archetype:

Class Description

CLOUFlusher

Items that are used infrequently are presented for removal before items that are used more often. (Least Often Used)

CLRUFlusher

Items that have not been used for a long time are presented for removal before items that have been used more recently. (Least Recently Used)

CNoFlusher

Used to disable the automatic removal of cache items based on access patterns.

COldFlusher

Items are presented for removal in the order in which they were added to the cache. (First In, First Out)

COrFlushers

Combines the functionality of two cache flushers into a single class.

Use

These template parameters expect the class to conform to this archetype:

Parameter name Used by

Flusher

CMemoryCacheBase

FlushClass

CMemoryCache

FlushClass

CBlobCache

FlushClass

CStencilCache

FlushClass

CFileCache

CFirst

COrFlushers

CSecond

COrFlushers