proland::TileStorage::Slot Class Reference

A slot managed by a TileStorage. More...

#include <TileStorage.h>

Inheritance diagram for proland::TileStorage::Slot:
proland::CPUTileStorage< T >::CPUSlot proland::ObjectTileStorage::ObjectSlot

List of all members.

Public Member Functions

 Slot (TileStorage *owner)
 Creates a new TileStorage::Slot.
virtual ~Slot ()
 Deletes this TileStorage::Slot.
TileStoragegetOwner ()
 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

TileStorageowner
 The TileStorage that manages this slot.
void * mutex
 A mutex used to serialize parallel accesses to this slot.

Detailed Description

A slot managed by a TileStorage.

Concrete sub classes of this class must provide a reference to the actual tile data.


Constructor & Destructor Documentation

proland::TileStorage::Slot::Slot ( TileStorage owner  ) 

Creates a new TileStorage::Slot.

Parameters:
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.


Member Function Documentation

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.

Parameters:
lock true to lock the slot, false to unlock it.

Member Data Documentation

pair<int, pair<int, pair<int, int> > > proland::TileStorage::Slot::id

The id of the tile currently stored in this slot.

A mutex used to serialize parallel accesses to this slot.

The TileStorage that manages this slot.

The task that is responsible for producing the data for the tile stored in this slot.


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