DGtal  0.9.3beta
Public Types | Public Member Functions | Protected Attributes | Private Member Functions
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory > Class Template Reference

#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 >))
 
 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
 
ImageFactorymyImageFactory
 

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:

Examples:
images/exampleImageFactoryFromHDF5.cpp.

Definition at line 77 of file ImageCachePolicies.h.

Member Typedef Documentation

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

Definition at line 88 of file ImageCachePolicies.h.

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

Definition at line 87 of file ImageCachePolicies.h.

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

Definition at line 85 of file ImageCachePolicies.h.

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

Definition at line 89 of file ImageCachePolicies.h.

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

Definition at line 90 of file ImageCachePolicies.h.

Constructor & Destructor Documentation

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  }
ImageFactory * myImageFactory
Alias on the image factory.
ImageContainer * myCacheImagesPtr
Alias on the images cache.
template<typename TImageContainer , typename TImageFactory >
DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::~ImageCacheReadPolicyLAST ( )
inline

Destructor. Does nothing

Definition at line 101 of file ImageCachePolicies.h.

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

Member Function Documentation

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

Checking concepts.

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

Clear the cache.

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.
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.
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.
template<typename TImageContainer , typename TImageFactory >
ImageCacheReadPolicyLAST& DGtal::ImageCacheReadPolicyLAST< TImageContainer, TImageFactory >::operator= ( const ImageCacheReadPolicyLAST< TImageContainer, TImageFactory > &  other)
private
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

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.

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: