DGtal  1.5.beta
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory > Class Template Reference

Aim: implements a 'LAST' read policy cache. More...

#include <DGtal/images/ImageCachePolicies.h>

Public Types

typedef TImageFactory ImageFactory
 
typedef TImageContainer ImageContainer
 
typedef TImageContainer::Domain Domain
 
typedef TImageContainer::Point Point
 
typedef TImageContainer::Value Value
 

Public Member Functions

 BOOST_CONCEPT_ASSERT ((concepts::CImage< TImageContainer >))
 Checking concepts. More...
 
 BOOST_CONCEPT_ASSERT ((concepts::CImageFactory< TImageFactory >))
 
 ImageCacheReadPolicyLAST (Alias< ImageFactory > anImageFactory)
 
 ~ImageCacheReadPolicyLAST ()
 
ImageContainergetPage (const Point &aPoint)
 
ImageContainergetPage (const Domain &aDomain)
 
ImageContainergetPageToDetach ()
 
void updateCache (const Domain &aDomain)
 
void clearCache ()
 

Protected Attributes

ImageContainermyCacheImagesPtr
 Alias on the images cache. More...
 
ImageFactorymyImageFactory
 Alias on the image factory. More...
 

Private Member Functions

 ImageCacheReadPolicyLAST (const ImageCacheReadPolicyLAST &other)
 
ImageCacheReadPolicyLASToperator= (const ImageCacheReadPolicyLAST &other)
 

Detailed Description

template<typename TImageContainer, typename TImageFactory>
class DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >

Aim: implements a 'LAST' read policy cache.

Description of template class 'ImageCacheReadPolicyLAST'

The cache keeps only one page in memory, the last one. When the page needs to be replaced, the new page replaces the old one.

Template Parameters
TImageContaineran image container type (model of CImage).
TImageFactoryan image factory.

The policy is done with 5 functions:

  • getPage : for getting the alias on the image that contains a point or NULL if no image in the cache contains that point
  • getPage : for getting the alias on the image that contains a domain or NULL if no image in the cache contains that domain
  • getPageToDetach : for getting the alias on the image that we have to detach or NULL if no image have to be detached
  • updateCache : for updating the cache according to the cache policy
  • clearCache : for clearing the cache

Definition at line 77 of file ImageCachePolicies.h.

Member Typedef Documentation

◆ Domain

template<typename TImageContainer , typename TImageFactory >
typedef TImageContainer::Domain DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::Domain

Definition at line 88 of file ImageCachePolicies.h.

◆ ImageContainer

template<typename TImageContainer , typename TImageFactory >
typedef TImageContainer DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::ImageContainer

Definition at line 87 of file ImageCachePolicies.h.

◆ ImageFactory

template<typename TImageContainer , typename TImageFactory >
typedef TImageFactory DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::ImageFactory

Definition at line 85 of file ImageCachePolicies.h.

◆ Point

template<typename TImageContainer , typename TImageFactory >
typedef TImageContainer::Point DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::Point

Definition at line 89 of file ImageCachePolicies.h.

◆ Value

template<typename TImageContainer , typename TImageFactory >
typedef TImageContainer::Value DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::Value

Definition at line 90 of file ImageCachePolicies.h.

Constructor & Destructor Documentation

◆ ImageCacheReadPolicyLAST() [1/2]

template<typename TImageContainer , typename TImageFactory >
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::ImageCacheReadPolicyLAST ( Alias< ImageFactory anImageFactory)
inline

Definition at line 92 of file ImageCachePolicies.h.

92  :
93  myCacheImagesPtr(NULL), myImageFactory(&anImageFactory)
94  {
95  }
ImageContainer * myCacheImagesPtr
Alias on the images cache.
ImageFactory * myImageFactory
Alias on the image factory.

◆ ~ImageCacheReadPolicyLAST()

template<typename TImageContainer , typename TImageFactory >
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::~ImageCacheReadPolicyLAST ( )
inline

Destructor. Does nothing

Definition at line 101 of file ImageCachePolicies.h.

101 {}

◆ ImageCacheReadPolicyLAST() [2/2]

template<typename TImageContainer , typename TImageFactory >
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::ImageCacheReadPolicyLAST ( const ImageCacheReadPolicyLAST< TImageContainer, TImageFactory > &  other)
private

Member Function Documentation

◆ BOOST_CONCEPT_ASSERT() [1/2]

template<typename TImageContainer , typename TImageFactory >
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::BOOST_CONCEPT_ASSERT ( (concepts::CImage< TImageContainer >)  )

Checking concepts.

◆ BOOST_CONCEPT_ASSERT() [2/2]

template<typename TImageContainer , typename TImageFactory >
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::BOOST_CONCEPT_ASSERT ( (concepts::CImageFactory< TImageFactory >)  )

◆ clearCache()

template<typename TImageContainer , typename TImageFactory >
void DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::clearCache ( )

Clear the cache.

◆ getPage() [1/2]

template<typename TImageContainer , typename TImageFactory >
ImageContainer* DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::getPage ( const Domain aDomain)

Get the alias on the image that matchs the domain aDomain or NULL if no image in the cache matchs the domain aDomain.

Parameters
aDomainthe domain.
Returns
the alias on the image container or NULL pointer.

◆ getPage() [2/2]

template<typename TImageContainer , typename TImageFactory >
ImageContainer* DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::getPage ( const Point aPoint)

Get the alias on the image that contains the point aPoint or NULL if no image in the cache contains the point aPoint.

Parameters
aPointthe point.
Returns
the alias on the image container or NULL pointer.

◆ getPageToDetach()

template<typename TImageContainer , typename TImageFactory >
ImageContainer* DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::getPageToDetach ( )

Get the alias on the image that we have to detach or NULL if no image have to be detached.

Returns
the alias on the image container or NULL pointer.

◆ operator=()

template<typename TImageContainer , typename TImageFactory >
ImageCacheReadPolicyLAST& DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::operator= ( const ImageCacheReadPolicyLAST< TImageContainer, TImageFactory > &  other)
private

◆ updateCache()

template<typename TImageContainer , typename TImageFactory >
void DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::updateCache ( const Domain aDomain)

Update the cache according to the cache policy.

Parameters
aDomainthe domain.

Field Documentation

◆ myCacheImagesPtr

template<typename TImageContainer , typename TImageFactory >
ImageContainer* DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::myCacheImagesPtr
protected

Alias on the images cache.

Definition at line 154 of file ImageCachePolicies.h.

◆ myImageFactory

template<typename TImageContainer , typename TImageFactory >
ImageFactory* DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::myImageFactory
protected

Alias on the image factory.

Definition at line 157 of file ImageCachePolicies.h.


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