![]() |
AliceVision
Photogrammetric Computer Vision Framework
|
#include <cache.hpp>
Public Types | |
| using | shared_ptr = std::shared_ptr< TileCacheManager > |
| using | MapCachedTile = std::map< size_t, CachedTile::weak_pointer > |
Public Types inherited from aliceVision::image::CacheManager | |
| using | IndexedStoragePaths = std::unordered_map< size_t, std::string > |
| using | IndexedFreeBlocks = std::unordered_map< size_t, std::list< size_t > > |
| using | MemoryMap = std::map< size_t, MemoryItem > |
| using | MRUType = boost::multi_index::multi_index_container< MRUItem, boost::multi_index::indexed_by< boost::multi_index::sequenced<>, boost::multi_index::hashed_unique< boost::multi_index::member< MRUItem, size_t, &MRUItem::objectId > >> > |
Public Member Functions | |
| void | notifyDestroy (size_t tileId) |
| bool | acquire (size_t tileId) |
| std::shared_ptr< CachedTile > | requireNewCachedTile (size_t width, size_t height, size_t blockCount) |
| template<class T > | |
| std::shared_ptr< CachedTile > | requireNewCachedTile (size_t width, size_t height) |
| size_t | getTileWidth () const |
| size_t | getTileHeight () const |
Public Member Functions inherited from aliceVision::image::CacheManager | |
| CacheManager (const std::string &pathStorage, size_t blockSize, size_t maxBlocksPerIndex) | |
| void | setMaxMemory (size_t maxMemorySize) |
| void | setInCoreMaxObjectCount (size_t max) |
| bool | createObject (size_t &objectId, size_t blockCount) |
| bool | acquireObject (std::unique_ptr< unsigned char > &data, size_t objectId) |
| size_t | getActiveBlocks () const |
Static Public Member Functions | |
| static std::shared_ptr< TileCacheManager > | create (const std::string &pathStorage, size_t tileWidth, size_t tileHeight, size_t maxTilesPerIndex) |
Protected Member Functions | |
| TileCacheManager (const std::string &pathStorage, size_t tileWidth, size_t tileHeight, size_t maxTilesPerIndex) | |
| virtual void | onRemovedFromMRU (size_t objectId) |
Protected Member Functions inherited from aliceVision::image::CacheManager | |
| std::string | getPathForIndex (size_t indexId) |
| void | deleteIndexFiles () |
| void | wipe () |
| bool | prepareBlockGroup (size_t startBlockId, size_t blocksCount) |
| std::unique_ptr< unsigned char > | load (size_t startBlockId, size_t blocksCount) |
| bool | save (std::unique_ptr< unsigned char > &&data, size_t startBlockId, size_t blockCount) |
| bool | saveObject (std::unique_ptr< unsigned char > &&data, size_t objectId) |
| void | addFreeBlock (size_t blockId, size_t blockCount) |
| size_t | getFreeBlockId (size_t blockCount) |
Protected Attributes | |
| size_t | _tileWidth |
| size_t | _tileHeight |
| MapCachedTile | _objectMap |
Protected Attributes inherited from aliceVision::image::CacheManager | |
| size_t | _blockSize {0} |
| size_t | _incoreBlockUsageCount {0} |
| size_t | _incoreBlockUsageMax {0} |
| size_t | _blockCountPerIndex {0} |
| size_t | _nextStartBlockId {0} |
| size_t | _nextObjectId {0} |
| std::string | _basePathStorage |
| IndexedStoragePaths | _indexPaths |
| IndexedFreeBlocks | _freeBlocks |
| MRUType | _mru |
| MemoryMap | _memoryMap |
A cache manager specialized for image tiles All tiles in this image have a size multiple of a given base tile size.
| bool aliceVision::image::TileCacheManager::acquire | ( | size_t | tileId | ) |
Acquire a given tile
| tileId | the tile index to acquire |
|
static |
There is no explicit constructor. We want to force the use of shared pointer for the manager
| pathStorage | the path to the directory where the file will be stored |
| tileWidth | the base width of a tile |
| tileWidth | the base height of a tile |
| maxTilesPerIndex | the maximal number of tiles for a given file (give a maximal size for a cache file) @retuurn the manager shared pointer |
|
inline |
Return the base tile height
|
inline |
Return the base tile width
| void aliceVision::image::TileCacheManager::notifyDestroy | ( | size_t | tileId | ) |
Notify the manager that a given tile was destroyed.
| tileId | the tile index which was destroyed |
| std::shared_ptr< CachedTile > aliceVision::image::TileCacheManager::requireNewCachedTile | ( | size_t | width, |
| size_t | height, | ||
| size_t | blockCount | ||
| ) |
Acquire a given tile
| width | the requested tile size (less or equal to the base tile size) |
| height | the requested tile size (less or equal to the base tile size) |
| blockCount | the requested tile size in depth |
1.8.17