|
|
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 > >> > |
| |
|
|
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) |
| |
|
virtual void | onRemovedFromMRU (size_t objectId)=0 |
| |
|
void | addFreeBlock (size_t blockId, size_t blockCount) |
| |
|
size_t | getFreeBlockId (size_t blockCount) |
| |
|
|
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 |
| |
◆ MRUType
Most recently used object container Used to know which objects have not been used for some time
◆ CacheManager()
| aliceVision::image::CacheManager::CacheManager |
( |
const std::string & |
pathStorage, |
|
|
size_t |
blockSize, |
|
|
size_t |
maxBlocksPerIndex |
|
) |
| |
Create a cache manager Each created object is associated to this manager.
- Parameters
-
| pathStorage | the path to the directory where the file will be stored |
| blockSize | the base size of an object |
| maxTilesPerIndex | the maximal number of blocks for a given file (give a maximal size for a cache file) |
◆ acquireObject()
| bool aliceVision::image::CacheManager::acquireObject |
( |
std::unique_ptr< unsigned char > & |
data, |
|
|
size_t |
objectId |
|
) |
| |
Acquire a given object
- Parameters
-
| data | the result data acquired |
| objectId | the object index to acquire |
- Returns
- true if the object was acquired
◆ createObject()
| bool aliceVision::image::CacheManager::createObject |
( |
size_t & |
objectId, |
|
|
size_t |
blockCount |
|
) |
| |
Create a new object of size block count
- Parameters
-
| objectId | the created object index |
| blockCount | the required size for this object (In number of blocks) |
- Returns
- true if the object was created
◆ getActiveBlocks()
| size_t aliceVision::image::CacheManager::getActiveBlocks |
( |
| ) |
const |
Get the number of managed blocks
- Returns
- a block count
◆ setInCoreMaxObjectCount()
| void aliceVision::image::CacheManager::setInCoreMaxObjectCount |
( |
size_t |
max | ) |
|
Set the maximal number number of items simultaneously in core
- Parameters
-
| max | the maximal number of items |
◆ setMaxMemory()
| void aliceVision::image::CacheManager::setMaxMemory |
( |
size_t |
maxMemorySize | ) |
|
Set the maximal memory size
- Parameters
-
| max | the maximal memory size |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/alicevision/checkouts/stable/src/aliceVision/image/cache.hpp
- /home/docs/checkouts/readthedocs.org/user_builds/alicevision/checkouts/stable/src/aliceVision/image/cache.cpp