Audacity 3.2.0
Public Member Functions | Public Attributes | List of all members
GraphicsDataCacheElementBase Struct Reference

A base class for the for cache elements. More...

#include <GraphicsDataCache.h>

Inheritance diagram for GraphicsDataCacheElementBase:
[legend]

Public Member Functions

virtual ~GraphicsDataCacheElementBase ()=default
 
virtual void Dispose ()
 This method is called when the item is evicted from the cache. Default implementation is empty. More...
 
virtual void Smooth (GraphicsDataCacheElementBase *prevElement)
 This method is called during the lookup when new items are inserted. prevElement can be nullptr. Default implementation is empty. More...
 

Public Attributes

uint64_t LastCacheAccess { 0 }
 Index filled by GraphicsDataCacheBase to implement LRU eviction policy. More...
 
uint64_t LastUpdate { 0 }
 The last time the item was updated. If (!IsComplete && LastUpdate < LastCacheAccess) the item will be updated. More...
 
bool IsComplete { false }
 Cache implementation is responsible to set this flag when all the data of the item is filled. More...
 
bool AwaitsEviction { false }
 This flag is used to simplify the eviction algorithm. More...
 

Detailed Description

A base class for the for cache elements.

Definition at line 35 of file GraphicsDataCache.h.

Constructor & Destructor Documentation

◆ ~GraphicsDataCacheElementBase()

virtual GraphicsDataCacheElementBase::~GraphicsDataCacheElementBase ( )
virtualdefault

Member Function Documentation

◆ Dispose()

void GraphicsDataCacheElementBase::Dispose ( )
virtual

This method is called when the item is evicted from the cache. Default implementation is empty.

Reimplemented in anonymous_namespace{GraphicsDataCacheTests.cpp}::CacheElement.

Definition at line 113 of file GraphicsDataCache.cpp.

114{
115}

Referenced by GraphicsDataCache< CacheElementType >::DisposeElement().

Here is the caller graph for this function:

◆ Smooth()

void GraphicsDataCacheElementBase::Smooth ( GraphicsDataCacheElementBase prevElement)
virtual

This method is called during the lookup when new items are inserted. prevElement can be nullptr. Default implementation is empty.

Reimplemented in WaveCacheElement.

Definition at line 117 of file GraphicsDataCache.cpp.

119{
120}

Referenced by GraphicsDataCacheBase::PerformBaseLookup().

Here is the caller graph for this function:

Member Data Documentation

◆ AwaitsEviction

bool GraphicsDataCacheElementBase::AwaitsEviction { false }

This flag is used to simplify the eviction algorithm.

Definition at line 50 of file GraphicsDataCache.h.

Referenced by WaveCacheElement::Smooth().

◆ IsComplete

bool GraphicsDataCacheElementBase::IsComplete { false }

Cache implementation is responsible to set this flag when all the data of the item is filled.

Definition at line 48 of file GraphicsDataCache.h.

Referenced by WaveBitmapCache::InitializeElement(), WaveDataCache::InitializeElement(), and GraphicsDataCacheBase::PerformBaseLookup().

◆ LastCacheAccess

uint64_t GraphicsDataCacheElementBase::LastCacheAccess { 0 }

Index filled by GraphicsDataCacheBase to implement LRU eviction policy.

Definition at line 44 of file GraphicsDataCache.h.

Referenced by GraphicsDataCacheBase::PerformBaseLookup().

◆ LastUpdate

uint64_t GraphicsDataCacheElementBase::LastUpdate { 0 }

The last time the item was updated. If (!IsComplete && LastUpdate < LastCacheAccess) the item will be updated.

Definition at line 46 of file GraphicsDataCache.h.

Referenced by GraphicsDataCacheBase::PerformBaseLookup().


The documentation for this struct was generated from the following files: