FIFE  be64c707dea6b3250bd4355bf5c825d25920087d
FIFE::Zone Class Reference

A Zone is an abstract depiction of a CellCache or of a part of it. More...

#include <cellcache.h>

+ Collaboration diagram for FIFE::Zone:

Public Member Functions

 Zone (uint32_t id)
 Constructor. More...
 
 ~Zone ()
 Destructor. More...
 
void addCell (Cell *cell)
 Adds a cell to this zone. More...
 
void removeCell (Cell *cell)
 Removes a cell from this zone. More...
 
void mergeZone (Zone *zone)
 Merge two zones to one. More...
 
const std::set< Cell * > & getCells () const
 Returns all cells of this zone. More...
 
void resetCells ()
 Remove all cells from zone but does not alter the cells. More...
 
uint32_t getId () const
 Returns the zone identifier. More...
 
uint32_t getCellCount () const
 Returns the number of cells. More...
 
std::vector< Cell * > getTransitionCells (Layer *layer=NULL)
 Returns transistion cells of this zone. More...
 

Private Attributes

uint32_t m_id
 identifier More...
 
std::set< Cell * > m_cells
 cells in the zone More...
 

Detailed Description

A Zone is an abstract depiction of a CellCache or of a part of it.

Definition at line 50 of file cellcache.h.

Constructor & Destructor Documentation

◆ Zone()

FIFE::Zone::Zone ( uint32_t  id)

Constructor.

Parameters
idA integer value used as identifier. Simple counter values are used.

Definition at line 260 of file cellcache.cpp.

◆ ~Zone()

FIFE::Zone::~Zone ( )

Destructor.

Definition at line 264 of file cellcache.cpp.

References m_cells.

Member Function Documentation

◆ addCell()

void FIFE::Zone::addCell ( Cell cell)

Adds a cell to this zone.

Parameters
cellA pointer to cell which should be added.

Definition at line 270 of file cellcache.cpp.

References FIFE::Cell::getZone(), m_cells, and FIFE::Cell::setZone().

Referenced by FIFE::CellCache::createCells(), and FIFE::CellCache::splitZone().

+ Here is the caller graph for this function:

◆ getCellCount()

uint32_t FIFE::Zone::getCellCount ( ) const

Returns the number of cells.

Returns
A unsigned integer with the number of cells.

Definition at line 306 of file cellcache.cpp.

References m_cells.

Referenced by FIFE::CellCache::mergeZones(), and FIFE::CellCache::splitZone().

+ Here is the caller graph for this function:

◆ getCells()

const std::set< Cell * > & FIFE::Zone::getCells ( ) const

Returns all cells of this zone.

Returns
A const reference to a set that contains all cells of this zone.

Definition at line 294 of file cellcache.cpp.

References m_cells.

Referenced by mergeZone().

+ Here is the caller graph for this function:

◆ getId()

uint32_t FIFE::Zone::getId ( ) const

Returns the zone identifier.

Returns
A unsigned integer with the identifier.

Definition at line 302 of file cellcache.cpp.

References m_id.

◆ getTransitionCells()

std::vector< Cell * > FIFE::Zone::getTransitionCells ( Layer layer = NULL)

Returns transistion cells of this zone.

Parameters
layerA pointer to the layer which should be the target of the transition. If NULL all transistions be returned.
Returns
A vector which contains the transition cells.

Definition at line 310 of file cellcache.cpp.

References m_cells.

Referenced by FIFE::MultiLayerSearch::searchBetweenTargetsMap().

+ Here is the caller graph for this function:

◆ mergeZone()

void FIFE::Zone::mergeZone ( Zone zone)

Merge two zones to one.

Parameters
zoneA pointer to the old zone.

Definition at line 285 of file cellcache.cpp.

References getCells(), m_cells, and resetCells().

Referenced by FIFE::CellCache::mergeZones().

+ Here is the caller graph for this function:

◆ removeCell()

void FIFE::Zone::removeCell ( Cell cell)

Removes a cell from this zone.

Parameters
cellA pointer to cell which should be removed.

Definition at line 277 of file cellcache.cpp.

References m_cells.

Referenced by FIFE::CellCache::splitZone(), and FIFE::Cell::~Cell().

+ Here is the caller graph for this function:

◆ resetCells()

void FIFE::Zone::resetCells ( )

Remove all cells from zone but does not alter the cells.

Definition at line 298 of file cellcache.cpp.

References m_cells.

Referenced by mergeZone().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cells

std::set<Cell*> FIFE::Zone::m_cells
private

cells in the zone

Definition at line 105 of file cellcache.h.

Referenced by addCell(), getCellCount(), getCells(), getTransitionCells(), mergeZone(), removeCell(), resetCells(), and ~Zone().

◆ m_id

uint32_t FIFE::Zone::m_id
private

identifier

Definition at line 103 of file cellcache.h.

Referenced by getId().


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