proland::TileCache::Tile Class Reference

A tile described by its level,tx,ty coordinates. More...

#include <TileCache.h>

List of all members.

Public Types

typedef pair< int, pair< int,
int > > 
Id
 A tile identifier for a given producer.
typedef pair< int, IdTId
 A tile identifier.

Public Member Functions

 Tile (int producerId, int level, int tx, int ty, ptr< Task > task, TileStorage::Slot *data)
 Creates a new tile.
 ~Tile ()
 Deletes this tile.
TileStorage::SlotgetData (bool check=true)
 Returns the actual data of this tile.
Id getId () const
 Returns the identifier of this tile.
TId getTId () const
 Returns the identifier of this tile.

Static Public Member Functions

static Id getId (int level, int tx, int ty)
 Returns the identifier of a tile.
static TId getTId (int producerId, int level, int tx, int ty)
 Returns the identifier of a tile.

Public Attributes

const int producerId
 The id of the producer that manages this tile.
const int level
 The quadtree level of this tile.
const int tx
 The quadtree x coordinate of this tile at level level.
const int ty
 The quadtree y coordinate of this tile at level level.
const ptr< Task > task
 The task that produces or produced the actual tile data.

Private Attributes

TileStorage::Slotdata
 The actual data of this tile.
int users
 The number of users of this tile.

Detailed Description

A tile described by its level,tx,ty coordinates.

A TileCache::Tile describes where the tile is stored in the TileStorage, how its data can be produced, and how many users currently use it.


Member Typedef Documentation

typedef pair<int, pair<int, int> > proland::TileCache::Tile::Id

A tile identifier for a given producer.

Contains the tile coordinates level, tx, ty.

typedef pair<int, Id> proland::TileCache::Tile::TId

A tile identifier.

Contains a producer id (first pair element) and tile coordinates level,tx,ty (second pair element).


Constructor & Destructor Documentation

proland::TileCache::Tile::Tile ( int  producerId,
int  level,
int  tx,
int  ty,
ptr< Task >  task,
TileStorage::Slot data 
)

Creates a new tile.

Parameters:
producerId the id of the producer of this tile.
level the quadtree level of this tile.
tx the quadtree x coordinate of this tile.
ty the quadtree y coordinate of this tile.
task the task that will produce the tile data.
data where the produced tile data must be stored.
proland::TileCache::Tile::~Tile (  ) 

Deletes this tile.

This does not delete the tile data itself, only the mapping between the tile and its location in the TileStorage.


Member Function Documentation

TileStorage::Slot* proland::TileCache::Tile::getData ( bool  check = true  ) 

Returns the actual data of this tile.

Parameters:
check true to check that the task that produced this data is actually done.
Returns:
the actual data of this tile, or NULL if the task that produces this data is not done.
static Id proland::TileCache::Tile::getId ( int  level,
int  tx,
int  ty 
) [static]

Returns the identifier of a tile.

Parameters:
level the tile's quadtree level.
tx the tile's quadtree x coordinate.
ty the tile's quadtree y coordinate.
Id proland::TileCache::Tile::getId (  )  const

Returns the identifier of this tile.

static TId proland::TileCache::Tile::getTId ( int  producerId,
int  level,
int  tx,
int  ty 
) [static]

Returns the identifier of a tile.

Parameters:
producerId the id of the tile's producer.
level the tile's quadtree level.
tx the tile's quadtree x coordinate.
ty the tile's quadtree y coordinate.
TId proland::TileCache::Tile::getTId (  )  const

Returns the identifier of this tile.


Member Data Documentation

The actual data of this tile.

This data is not ready before task is done.

The quadtree level of this tile.

The id of the producer that manages this tile.

This local id is assigned to each new producer that uses this TileCache.

The task that produces or produced the actual tile data.

The quadtree x coordinate of this tile at level level.

Varies between 0 and 2^level - 1.

The quadtree y coordinate of this tile at level level.

Varies between 0 and 2^level - 1.

The number of users of this tile.

This number is incremented by getTile and decremented by putTile. When it becomes 0 the tile becomes unused.


Generated on Sat May 12 09:41:38 2012 for proland by  doxygen 1.6.1