Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitk::SimpleHistogramCache Class Reference

Cache for SimpleHistogram objects to avoid redundant recomputation. More...

#include <mitkSimpleHistogram.h>

Collaboration diagram for mitk::SimpleHistogramCache:

Classes

class  Element
 Abstract base element stored in the histogram cache. More...
 

Public Types

typedef std::list< Element * > CacheContainer
 

Public Member Functions

 SimpleHistogramCache ()
 
 ~SimpleHistogramCache ()
 
SimpleHistogram * operator[] (BaseData::Pointer sp_BaseData)
 Retrieve or compute a histogram for the given BaseData. More...
 

Public Attributes

CacheContainer cache
 The list of cached elements. More...
 

Static Public Attributes

static const unsigned int maxCacheSize
 Maximum number of cached histogram entries. More...
 

Protected Member Functions

void TrimCache (bool full=false)
 

Detailed Description

Cache for SimpleHistogram objects to avoid redundant recomputation.

Maintains a list of histogram elements associated with BaseData objects. When a histogram for a particular BaseData is requested, the cache checks whether an up-to-date histogram already exists. The cache has a maximum size of 64 entries and trims oldest entries when full.

See also
SimpleHistogram

Definition at line 147 of file mitkSimpleHistogram.h.

Member Typedef Documentation

◆ CacheContainer

Definition at line 180 of file mitkSimpleHistogram.h.

Constructor & Destructor Documentation

◆ SimpleHistogramCache()

mitk::SimpleHistogramCache::SimpleHistogramCache ( )
inline

Definition at line 184 of file mitkSimpleHistogram.h.

◆ ~SimpleHistogramCache()

mitk::SimpleHistogramCache::~SimpleHistogramCache ( )
inline

Definition at line 185 of file mitkSimpleHistogram.h.

Member Function Documentation

◆ operator[]()

SimpleHistogram* mitk::SimpleHistogramCache::operator[] ( BaseData::Pointer  sp_BaseData)

Retrieve or compute a histogram for the given BaseData.

Parameters
[in]sp_BaseDataSmart pointer to the BaseData.
Returns
Pointer to the cached or newly computed SimpleHistogram.

◆ TrimCache()

void mitk::SimpleHistogramCache::TrimCache ( bool  full = false)
inlineprotected

Definition at line 195 of file mitkSimpleHistogram.h.

Member Data Documentation

◆ cache

CacheContainer mitk::SimpleHistogramCache::cache

The list of cached elements.

Definition at line 182 of file mitkSimpleHistogram.h.

◆ maxCacheSize

const unsigned int mitk::SimpleHistogramCache::maxCacheSize
static

Maximum number of cached histogram entries.

Definition at line 151 of file mitkSimpleHistogram.h.


The documentation for this class was generated from the following file: