SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceXtractor::TileManager Class Reference

#include <TileManager.h>

Collaboration diagram for SourceXtractor::TileManager:

Public Member Functions

 TileManager ()
virtual ~TileManager ()
void setOptions (int tile_width, int tile_height, int max_memory)
void flush ()
std::shared_ptr< ImageTilegetTileForPixel (int x, int y, std::shared_ptr< const ImageSource > source)
void saveAllTiles ()
int getTileWidth () const
int getTileHeight () const

Static Public Member Functions

static std::shared_ptr< TileManagergetInstance ()

Private Member Functions

std::shared_ptr< ImageTiletryTileFromCache (const TileKey &key)
std::shared_ptr< boost::mutex > & getMutexForImageSource (const ImageSource *)
void removeTile (TileKey tile_key)
void removeExtraTiles ()
void addTile (TileKey key, std::shared_ptr< ImageTile > tile)

Private Attributes

int m_tile_width
int m_tile_height
long m_max_memory
long m_total_memory_used
std::unordered_map< TileKey, std::shared_ptr< ImageTile > > m_tile_map
std::unordered_map< const ImageSource *, std::shared_ptr< boost::mutex > > m_mutex_map
std::list< TileKeym_tile_list
boost::shared_mutex m_mutex

Detailed Description

Definition at line 75 of file TileManager.h.

Constructor & Destructor Documentation

◆ TileManager()

SourceXtractor::TileManager::TileManager ( )

Definition at line 42 of file TileManager.cpp.

References m_max_memory, m_tile_height, m_tile_width, and m_total_memory_used.

◆ ~TileManager()

SourceXtractor::TileManager::~TileManager ( )
virtual

Definition at line 46 of file TileManager.cpp.

References SourceXtractor::s_tile_logger, and saveAllTiles().

Here is the call graph for this function:

Member Function Documentation

◆ addTile()

void SourceXtractor::TileManager::addTile ( TileKey key,
std::shared_ptr< ImageTile > tile )
private

Definition at line 185 of file TileManager.cpp.

References m_tile_list, m_tile_map, m_total_memory_used, and SourceXtractor::s_tile_logger.

Referenced by getTileForPixel().

◆ flush()

void SourceXtractor::TileManager::flush ( )

Definition at line 63 of file TileManager.cpp.

References m_mutex, m_tile_list, m_tile_map, m_total_memory_used, and saveAllTiles().

Referenced by setOptions().

Here is the call graph for this function:

◆ getInstance()

◆ getMutexForImageSource()

std::shared_ptr< boost::mutex > & SourceXtractor::TileManager::getMutexForImageSource ( const ImageSource * src_ptr)
private

Definition at line 94 of file TileManager.cpp.

References m_mutex, m_mutex_map, and std::make_shared().

Referenced by getTileForPixel().

Here is the call graph for this function:

◆ getTileForPixel()

std::shared_ptr< ImageTile > SourceXtractor::TileManager::getTileForPixel ( int x,
int y,
std::shared_ptr< const ImageSource > source )

◆ getTileHeight()

int SourceXtractor::TileManager::getTileHeight ( ) const

Definition at line 159 of file TileManager.cpp.

References m_tile_height.

◆ getTileWidth()

int SourceXtractor::TileManager::getTileWidth ( ) const

Definition at line 155 of file TileManager.cpp.

References m_tile_width.

◆ removeExtraTiles()

void SourceXtractor::TileManager::removeExtraTiles ( )
private

Definition at line 176 of file TileManager.cpp.

References m_max_memory, m_tile_list, m_total_memory_used, and removeTile().

Referenced by getTileForPixel().

Here is the call graph for this function:

◆ removeTile()

void SourceXtractor::TileManager::removeTile ( TileKey tile_key)
private

Definition at line 163 of file TileManager.cpp.

References m_tile_map, m_total_memory_used, and SourceXtractor::s_tile_logger.

Referenced by removeExtraTiles().

◆ saveAllTiles()

void SourceXtractor::TileManager::saveAllTiles ( )

Definition at line 147 of file TileManager.cpp.

References m_mutex, m_tile_list, and m_tile_map.

Referenced by flush(), and ~TileManager().

◆ setOptions()

void SourceXtractor::TileManager::setOptions ( int tile_width,
int tile_height,
int max_memory )

Definition at line 54 of file TileManager.cpp.

References flush(), m_max_memory, m_mutex, m_tile_height, and m_tile_width.

Here is the call graph for this function:

◆ tryTileFromCache()

std::shared_ptr< ImageTile > SourceXtractor::TileManager::tryTileFromCache ( const TileKey & key)
private

Definition at line 78 of file TileManager.cpp.

References std::dynamic_pointer_cast(), m_mutex, m_tile_map, and SourceXtractor::s_tile_logger.

Referenced by getTileForPixel().

Here is the call graph for this function:

Member Data Documentation

◆ m_max_memory

long SourceXtractor::TileManager::m_max_memory
private

Definition at line 111 of file TileManager.h.

Referenced by removeExtraTiles(), setOptions(), and TileManager().

◆ m_mutex

boost::shared_mutex SourceXtractor::TileManager::m_mutex
private

◆ m_mutex_map

std::unordered_map<const ImageSource*, std::shared_ptr<boost::mutex> > SourceXtractor::TileManager::m_mutex_map
private

Definition at line 115 of file TileManager.h.

Referenced by getMutexForImageSource().

◆ m_tile_height

int SourceXtractor::TileManager::m_tile_height
private

Definition at line 110 of file TileManager.h.

Referenced by getTileForPixel(), getTileHeight(), setOptions(), and TileManager().

◆ m_tile_list

std::list<TileKey> SourceXtractor::TileManager::m_tile_list
private

Definition at line 116 of file TileManager.h.

Referenced by addTile(), flush(), removeExtraTiles(), and saveAllTiles().

◆ m_tile_map

std::unordered_map<TileKey, std::shared_ptr<ImageTile> > SourceXtractor::TileManager::m_tile_map
private

Definition at line 114 of file TileManager.h.

Referenced by addTile(), flush(), removeTile(), saveAllTiles(), and tryTileFromCache().

◆ m_tile_width

int SourceXtractor::TileManager::m_tile_width
private

Definition at line 110 of file TileManager.h.

Referenced by getTileForPixel(), getTileWidth(), setOptions(), and TileManager().

◆ m_total_memory_used

long SourceXtractor::TileManager::m_total_memory_used
private

Definition at line 112 of file TileManager.h.

Referenced by addTile(), flush(), removeExtraTiles(), removeTile(), and TileManager().


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