SourceXtractorPlusPlus  0.10
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 ()
 
template<typename T >
std::shared_ptr< ImageTile< T > > getTileForPixel (int x, int y, std::shared_ptr< const ImageSource< T >> 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< ImageTileBase > 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< ImageTileBase > > 
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< ImageTileBase tile 
)
inlineprivate

Definition at line 184 of file TileManager.h.

References Elements::Logging::debug(), m_tile_list, m_tile_logger, m_tile_map, and m_total_memory_used.

Referenced by getTileForPixel().

Here is the call graph for this function:

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
template<typename T >
std::shared_ptr<ImageTile<T> > SourceXtractor::TileManager::getTileForPixel ( int  x,
int  y,
std::shared_ptr< const ImageSource< T >>  source 
)
inline

Definition at line 115 of file TileManager.h.

References addTile(), Elements::Logging::debug(), std::dynamic_pointer_cast(), std::lock(), m_mutex, m_tile_height, m_tile_logger, 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 156 of file TileManager.h.

References m_tile_height.

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

Definition at line 152 of file TileManager.h.

References m_tile_width.

void SourceXtractor::TileManager::removeExtraTiles ( )
inlineprivate

Definition at line 175 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 162 of file TileManager.h.

References Elements::Logging::debug(), m_tile_logger, m_tile_map, and m_total_memory_used.

Referenced by removeExtraTiles().

Here is the call graph for this function:

void SourceXtractor::TileManager::saveAllTiles ( )
inline

Definition at line 144 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 195 of file TileManager.h.

Referenced by removeExtraTiles(), and setOptions().

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

Definition at line 201 of file TileManager.h.

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

int SourceXtractor::TileManager::m_tile_height
private

Definition at line 194 of file TileManager.h.

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

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

Definition at line 199 of file TileManager.h.

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

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

Definition at line 203 of file TileManager.h.

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

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

Definition at line 198 of file TileManager.h.

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

int SourceXtractor::TileManager::m_tile_width
private

Definition at line 194 of file TileManager.h.

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

long SourceXtractor::TileManager::m_total_memory_used
private

Definition at line 196 of file TileManager.h.

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

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

Definition at line 205 of file TileManager.h.

Referenced by getInstance().


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