| TerraLib 4.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Examples

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Attributes
TeCoverageDecoderCacheLRU< T > Class Template Reference

Class to decode a generic Coverage using LRU caching method. More...

`#include <TeCoverageDecoderCacheLRU.h>`

Inheritance diagram for TeCoverageDecoderCacheLRU< T >:

List of all members.

## Public Member Functions

| TeCoverageDecoderCacheLRU (TeCoverageParams &params, const unsigned int capacity=0)
| Constructor from parameters and capacity.
virtual | ~TeCoverageDecoderCacheLRU ()
| Destructor.
virtual void | init ()
| Initialize internal structures.
virtual void | clear ()
| Clear internal structures.
virtual void | selectBlocks (const TePolygon &poly, const TeSpatialRelation relation, std::vector< TeCoverageBlock< T > > &selected, std::set< int > &dontSelect)
| Select generic coverage blocks from the coverage data.

## Protected Attributes

TeCoverageDecoder< T > * | decoder_
| Support coverage decoder.
std::list< TeCoverageBlock< T > > | cache_
| List of cached blocks.
unsigned int | capacity_
| Cache capacity.

## Detailed Description

### template<class T>
class TeCoverageDecoderCacheLRU< T >

Class to decode a generic Coverage using LRU caching method.

This class assumes that the coverage data will be provided as
  coverage blocks by a support decoder, and uses a memory caching method to access this this support decoder less often.

The caching policy used is LRU (which stands for Least Recently
  Used), meaning that the most recently used blocks are kept available, whereas the least recently used blocks are discarded.

The cache capacity (in number of blocks) may be specified in the
  constructor, otherwise a default capacity is used.

## Constructor & Destructor Documentation

template<class T >

TeCoverageDecoderCacheLRU< T >::TeCoverageDecoderCacheLRU | ( | TeCoverageParams & | params,
|  | const unsigned int | capacity = `0`
| ) |  | `[inline]`

Constructor from parameters and capacity.

template<class T >

virtual TeCoverageDecoderCacheLRU< T >::~TeCoverageDecoderCacheLRU | ( |  | ) | `[inline, virtual]`

Destructor.

## Member Function Documentation

template<class T >

virtual void TeCoverageDecoderCacheLRU< T >::clear | ( |  | ) | `[inline, virtual]`

Clear internal structures.

Clear internal structures, must be called before disposing of the decoder.

Reimplemented from TeCoverageDecoder< T >.

template<class T >

virtual void TeCoverageDecoderCacheLRU< T >::init | ( |  | ) | `[inline, virtual]`

Initialize internal structures.

Instantiate internal structures, must be called before any attempt to access the coverage data.

Reimplemented from TeCoverageDecoder< T >.

template<class T >

virtual void TeCoverageDecoderCacheLRU< T >::selectBlocks | ( | const TePolygon & | poly,
|  | const TeSpatialRelation | relation,
|  | std::vector< TeCoverageBlock< T > > & | selected,
|  | std::set< int > & | dontSelect
| ) |  | `[inline, virtual]`

Select generic coverage blocks from the coverage data.

Select generic coverage blocks from the coverage data.

The polygon parameter defines a selection area and the relation
  parameter specifies the kind of relation (e.g. intersection, crossing, overlapping) that holds between the selection area and at least one geometry in each block to be selected.

Parameters:

  poly | an instance of TePolygon representing a selection area
  relation | a spatial relation
  dontSelect | list IDs of blocks that must not be retrieved

See also:
  TeCoverageBlock TeSpatialRelation

Implements TeCoverageDecoder< T >.

## Member Data Documentation

template<class T >

std::list<TeCoverageBlock<T> > TeCoverageDecoderCacheLRU< T >::cache_`[protected]`

List of cached blocks.

template<class T >

unsigned int TeCoverageDecoderCacheLRU< T >::capacity_`[protected]`

Cache capacity.

template<class T >

TeCoverageDecoder<T>* TeCoverageDecoderCacheLRU< T >::decoder_`[protected]`

Support coverage decoder.

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

- E:/Projetos_Primeiro_Semestre_2012/TerraView/terralib/src/terralib/kernel/TeCoverageDecoderCacheLRU.h

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines