A slot managed by a TileStorage. More...
#include <TileStorage.h>
Public Member Functions | |
Slot (TileStorage *owner) | |
Creates a new TileStorage::Slot. | |
virtual | ~Slot () |
Deletes this TileStorage::Slot. | |
TileStorage * | getOwner () |
Returns the TileStorage that manages this slot. | |
void | lock (bool lock) |
Locks or unlocks this slots. | |
Public Attributes | |
pair< int, pair< int, pair < int, int > > > | id |
The id of the tile currently stored in this slot. | |
void * | producerTask |
The task that is responsible for producing the data for the tile stored in this slot. | |
Private Attributes | |
TileStorage * | owner |
The TileStorage that manages this slot. | |
void * | mutex |
A mutex used to serialize parallel accesses to this slot. |
A slot managed by a TileStorage.
Concrete sub classes of this class must provide a reference to the actual tile data.
proland::TileStorage::Slot::Slot | ( | TileStorage * | owner | ) |
Creates a new TileStorage::Slot.
owner | the TileStorage that will manage this slot. |
virtual proland::TileStorage::Slot::~Slot | ( | ) | [virtual] |
Deletes this TileStorage::Slot.
This destroys the data of the tile stored in this slot, if any.
TileStorage* proland::TileStorage::Slot::getOwner | ( | ) |
Returns the TileStorage that manages this slot.
void proland::TileStorage::Slot::lock | ( | bool | lock | ) |
Locks or unlocks this slots.
Slots can be accessed by several threads simultaneously. This lock can be used to serialize these accesses. In particular it is used to change the producerTask, when a slot is reused to store new data.
lock | true to lock the slot, false to unlock it. |
pair<int, pair<int, pair<int, int> > > proland::TileStorage::Slot::id |
The id of the tile currently stored in this slot.
void* proland::TileStorage::Slot::mutex [private] |
A mutex used to serialize parallel accesses to this slot.
TileStorage* proland::TileStorage::Slot::owner [private] |
The TileStorage that manages this slot.
The task that is responsible for producing the data for the tile stored in this slot.