SourceXtractorPlusPlus  0.13
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SourceXtractor::TileManager Class Reference

#include <TileManager.h>

Collaboration diagram for SourceXtractor::TileManager:
[legend]

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
< TileManager
getInstance ()
 

Private Member Functions

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::list< TileKeym_tile_list
 
std::recursive_mutex m_mutex
 
Elements::Logging m_tile_logger
 

Static Private Attributes

static std::shared_ptr
< TileManager
s_instance
 

Detailed Description

Definition at line 82 of file TileManager.h.

Constructor & Destructor Documentation

SourceXtractor::TileManager::TileManager ( )
inline

Definition at line 85 of file TileManager.h.

virtual SourceXtractor::TileManager::~TileManager ( )
inlinevirtual

Definition at line 89 of file TileManager.h.

References saveAllTiles().

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 183 of file TileManager.h.

References m_tile_list, m_tile_map, and m_total_memory_used.

Referenced by getTileForPixel().

void SourceXtractor::TileManager::flush ( )
inline

Definition at line 104 of file TileManager.h.

References std::lock(), 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:

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

Definition at line 114 of file TileManager.h.

References addTile(), std::dynamic_pointer_cast(), std::lock(), m_mutex, m_tile_height, m_tile_map, m_tile_width, std::min(), removeExtraTiles(), std::static_pointer_cast(), x, and y.

Here is the call graph for this function:

int SourceXtractor::TileManager::getTileHeight ( ) const
inline

Definition at line 155 of file TileManager.h.

References m_tile_height.

int SourceXtractor::TileManager::getTileWidth ( ) const
inline

Definition at line 151 of file TileManager.h.

References m_tile_width.

void SourceXtractor::TileManager::removeExtraTiles ( )
inlineprivate

Definition at line 174 of file TileManager.h.

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

Referenced by getTileForPixel().

Here is the call graph for this function:

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

Definition at line 161 of file TileManager.h.

References m_tile_map, and m_total_memory_used.

Referenced by removeExtraTiles().

void SourceXtractor::TileManager::saveAllTiles ( )
inline

Definition at line 143 of file TileManager.h.

References m_mutex, m_tile_list, and m_tile_map.

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

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

Definition at line 94 of file TileManager.h.

References flush(), std::lock(), m_max_memory, m_mutex, m_tile_height, and m_tile_width.

Here is the call graph for this function:

Member Data Documentation

long SourceXtractor::TileManager::m_max_memory
private

Definition at line 194 of file TileManager.h.

Referenced by removeExtraTiles(), and setOptions().

std::recursive_mutex SourceXtractor::TileManager::m_mutex
private

Definition at line 200 of file TileManager.h.

Referenced by flush(), getTileForPixel(), saveAllTiles(), and setOptions().

int SourceXtractor::TileManager::m_tile_height
private

Definition at line 193 of file TileManager.h.

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

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

Definition at line 198 of file TileManager.h.

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

Elements::Logging SourceXtractor::TileManager::m_tile_logger
private

Definition at line 202 of file TileManager.h.

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

Definition at line 197 of file TileManager.h.

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

int SourceXtractor::TileManager::m_tile_width
private

Definition at line 193 of file TileManager.h.

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

long SourceXtractor::TileManager::m_total_memory_used
private

Definition at line 195 of file TileManager.h.

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

std::shared_ptr< TileManager > SourceXtractor::TileManager::s_instance
staticprivate

Definition at line 204 of file TileManager.h.

Referenced by getInstance().


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