DGtal 1.4.0
|
Aim: implements a 'FIFO' 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. | |
BOOST_CONCEPT_ASSERT ((concepts::CImageFactory< TImageFactory >)) | |
ImageCacheReadPolicyFIFO (Alias< ImageFactory > anImageFactory, int aFIFOSizeMax=10) | |
~ImageCacheReadPolicyFIFO () | |
ImageContainer * | getPage (const Point &aPoint) |
ImageContainer * | getPage (const Domain &aDomain) |
ImageContainer * | getPageToDetach () |
void | updateCache (const Domain &aDomain) |
void | clearCache () |
Protected Attributes | |
std::deque< ImageContainer * > | myFIFOCacheImages |
Alias on the images cache. | |
unsigned int | myFIFOSizeMax |
Size max of the FIFO. | |
ImageFactory * | myImageFactory |
Alias on the image factory. | |
Private Member Functions | |
ImageCacheReadPolicyFIFO (const ImageCacheReadPolicyFIFO &other) | |
ImageCacheReadPolicyFIFO & | operator= (const ImageCacheReadPolicyFIFO &other) |
Aim: implements a 'FIFO' read policy cache.
Description of template class 'ImageCacheReadPolicyFIFO'
The cache keeps track of all the pages in memory in a queue, with the most recent arrival at the back, and the earliest arrival in front. When a page needs to be replaced, the page at the front of the queue (the oldest page) is selected.
TImageContainer | an image container type (model of CImage). |
TImageFactory | an image factory. |
The policy is done with 5 functions:
Definition at line 182 of file ImageCachePolicies.h.
typedef TImageContainer::Domain DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::Domain |
Definition at line 193 of file ImageCachePolicies.h.
typedef TImageContainer DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::ImageContainer |
Definition at line 192 of file ImageCachePolicies.h.
typedef TImageFactory DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::ImageFactory |
Definition at line 190 of file ImageCachePolicies.h.
typedef TImageContainer::Point DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::Point |
Definition at line 194 of file ImageCachePolicies.h.
typedef TImageContainer::Value DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::Value |
Definition at line 195 of file ImageCachePolicies.h.
|
inline |
Definition at line 197 of file ImageCachePolicies.h.
|
inline |
|
private |
DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::BOOST_CONCEPT_ASSERT | ( | (concepts::CImage< TImageContainer >) | ) |
Checking concepts.
DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::BOOST_CONCEPT_ASSERT | ( | (concepts::CImageFactory< TImageFactory >) | ) |
void DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::clearCache | ( | ) |
Clear the cache.
ImageContainer * DGtal::ImageCacheReadPolicyFIFO< 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.
aDomain | the domain. |
ImageContainer * DGtal::ImageCacheReadPolicyFIFO< 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.
aPoint | the point. |
ImageContainer * DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::getPageToDetach | ( | ) |
Get the alias on the image that we have to detach or NULL if no image have to be detached.
|
private |
void DGtal::ImageCacheReadPolicyFIFO< TImageContainer, TImageFactory >::updateCache | ( | const Domain & | aDomain | ) |
Update the cache according to the cache policy.
aDomain | the domain. |
|
protected |
Alias on the images cache.
Definition at line 259 of file ImageCachePolicies.h.
|
protected |
Size max of the FIFO.
Definition at line 262 of file ImageCachePolicies.h.
|
protected |
Alias on the image factory.
Definition at line 265 of file ImageCachePolicies.h.