A tile described by its level,tx,ty coordinates. More...
#include <TileCache.h>
Public Types | |
typedef pair< int, pair< int, int > > | Id |
A tile identifier for a given producer. | |
typedef pair< int, Id > | TId |
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::Slot * | getData (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::Slot * | data |
The actual data of this tile. | |
int | users |
The number of users of this tile. |
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.
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).
proland::TileCache::Tile::Tile | ( | int | producerId, | |
int | level, | |||
int | tx, | |||
int | ty, | |||
ptr< Task > | task, | |||
TileStorage::Slot * | data | |||
) |
Creates a new tile.
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.
TileStorage::Slot* proland::TileCache::Tile::getData | ( | bool | check = true |
) |
Returns the actual data of this tile.
check | true to check that the task that produced this data is actually done. |
static Id proland::TileCache::Tile::getId | ( | int | level, | |
int | tx, | |||
int | ty | |||
) | [static] |
Returns the identifier of a tile.
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.
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.
TileStorage::Slot* proland::TileCache::Tile::data [private] |
The actual data of this tile.
This data is not ready before task is done.
const int proland::TileCache::Tile::level |
The quadtree level of this tile.
const int proland::TileCache::Tile::producerId |
The id of the producer that manages this tile.
This local id is assigned to each new producer that uses this TileCache.
const ptr<Task> proland::TileCache::Tile::task |
The task that produces or produced the actual tile data.
const int proland::TileCache::Tile::tx |
The quadtree x coordinate of this tile at level level.
Varies between 0 and 2^level - 1.
const int proland::TileCache::Tile::ty |
The quadtree y coordinate of this tile at level level.
Varies between 0 and 2^level - 1.
int proland::TileCache::Tile::users [private] |