Skip to main content
ATL Server Library Reference 
Cache Culler Archetype 

Classes that conform to the cache culler archetype can be used to determine whether, and in what order, items should be removed from a CMemoryCacheBase-derived cache using time-based criteria.

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 is being added to the cache.

Commit

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

GetExpired

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

IsExpired

Called by the cache to determine if an item has expired and 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.

Start

Called by the cache when it intends to call GetExpired multiple times to remove items from the cache.

Existing Implementations

These classes conform to this archetype:

Class Description

CExpireCuller

Allows the automatic removal of cache items that exceed the absolute expiration time set by users of the cache.

CFixedLifetimeCuller

Allows the automatic removal of cache items that have not been accessed in a certain period. The lifetime of items in the cache cannot be changed at run time and is the same for all items.

CLifetimeCuller

Allows the automatic removal of cache items that have not been accessed in a certain period. The lifetime of an item can be changed at run time and can be different for each of the items in the cache.

CNoExpireCuller

Disables the automatic removal of cache items based on expiration times.

COrCullers

This class combines the functionality of two cache cullers into a single class.

Use

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

Parameter name Used by

Culler

CMemoryCacheBase

CullClass

CMemoryCache

CullClass

CBlobCache

CullClass

CStencilCache

CullClass

CFileCache

CFirst

COrCullers

CSecond

COrCullers