public |
Inheritance Graph
graph BT
CacheManager
click CacheManager "classMinSG_1_1OutOfCore_1_1CacheManager"
Description
Class to manage the cache levels and the positions of the cache objects inside these cache levels based on the given priorities. It is the interface between the environment using Rendering::Mesh and the cache system using CacheObject .
Author: Benjamin Eikel
Date: 2011-02-21
Public Functions
CacheManager() | |
~CacheManager() | |
uint16_t | setUserPriority( Rendering::Mesh * mesh, uint16_t userPriority) |
void | meshDisplay( Rendering::Mesh * mesh) |
cacheLevelId_t | addCacheLevel( CacheLevelType type, uint64_t size) |
void | clear() Remove all cache levels and cache objects. |
const CacheLevel * | getCacheLevel( cacheLevelId_t levelId) const |
void | addFileSystemObject( Rendering::Mesh * mesh) |
void | removeLargeCacheObject( CacheObject * object, cacheLevelId_t levelId, uint64_t size) |
void | trigger() |
void | updateStatistics( Statistics & statistics) |
CacheContext & | getCacheContext() Access the associated cache context. |
Documentation
function
MinSG::OutOfCore::CacheManager::CacheManager
public |
CacheManager( | ) |
Defined in MinSG/Ext/OutOfCore/CacheManager.h:56
function
MinSG::OutOfCore::CacheManager::~CacheManager
public |
~CacheManager( | ) |
Defined in MinSG/Ext/OutOfCore/CacheManager.h:58
function
MinSG::OutOfCore::CacheManager::setUserPriority
public |
uint16_t setUserPriority( | Rendering::Mesh * | mesh, |
uint16_t | userPriority | |
) |
Change the user priority of a mesh inside the cache hierarchy. All cache levels have to be traversed for this change. Therefore this is a rather costly operation. Nothing is done if the new priority is equal to the old priority.
Parameters
- mesh
- Mesh to change the priority of.
- userPriority
- New priority for the given mesh.
Returns
Previous user priority
Exceptions
- std::exception
- if an error occurred (e.g. the given mesh is unknown).
Defined in MinSG/Ext/OutOfCore/CacheManager.h:71
function
MinSG::OutOfCore::CacheManager::meshDisplay
public |
void meshDisplay( | Rendering::Mesh * | mesh ) |
Inform this manager that a mesh is displayed. This changes the priority of a mesh inside the cache hierarchy. All cache levels have to be traversed for this change. Therefore this is a rather costly operation.
Parameters
- mesh
- Mesh that is displayed
Exceptions
- std::exception
- if an error occurred (e.g. the given mesh is unknown).
Defined in MinSG/Ext/OutOfCore/CacheManager.h:82
function
MinSG::OutOfCore::CacheManager::addCacheLevel
public |
cacheLevelId_t addCacheLevel( | CacheLevelType | type, |
uint64_t | size | |
) |
Add a new level to the top of the cache hierarchy. For creating a cache hierarchy the levels have to be added from bottom (e.g. network) to top (e.g. graphics memory).
Parameters
- type
- Type of the cache level to add
- size
- Size of the cache level in bytes
Returns
Identifier of the new cache level
Exceptions
- std::exception
- if an error occurred
Defined in MinSG/Ext/OutOfCore/CacheManager.h:93
function
MinSG::OutOfCore::CacheManager::clear
public |
void clear( | ) |
Remove all cache levels and cache objects.
Defined in MinSG/Ext/OutOfCore/CacheManager.h:96
function
MinSG::OutOfCore::CacheManager::getCacheLevel
public | const | inline |
const CacheLevel * getCacheLevel( | cacheLevelId_t | levelId ) const |
Return the cache level with the given identifier.
Returns
Pointer to a constant cache level.
Defined in MinSG/Ext/OutOfCore/CacheManager.h:103
function
MinSG::OutOfCore::CacheManager::addFileSystemObject
public |
void addFileSystemObject( | Rendering::Mesh * | mesh ) |
Add a new mesh that is currently located at a file system location.
Note: The location, from which the mesh can be loaded, is stored inside the mesh.
Parameters
- mesh
- Currently empty mesh.
Exceptions
- std::exception
- in case of an error (e.g. there is no file system cache level).
Defined in MinSG/Ext/OutOfCore/CacheManager.h:117
function
MinSG::OutOfCore::CacheManager::removeLargeCacheObject
public |
void removeLargeCacheObject( | CacheObject * | object, |
cacheLevelId_t | levelId, | |
uint64_t | size | |
) |
Remove a cache object that is too large for the cache system. A warning message is generated for it and output on stdout. The cache object is remove from all entities in the out-of-core system and its data strategy is changed
Parameters
- object
- Cache object that is too large
- levelId
- Cache level that reports the large cache object
- size
- Size of the given cache object
Defined in MinSG/Ext/OutOfCore/CacheManager.h:129
function
MinSG::OutOfCore::CacheManager::trigger
public |
void trigger( | ) |
Do the real work here: Swap cache objects in and out. This function is called by a frame listener before each frame.
Defined in MinSG/Ext/OutOfCore/CacheManager.h:137
function
MinSG::OutOfCore::CacheManager::updateStatistics
public |
void updateStatistics( | Statistics & | statistics ) |
Tell the statistics object the fill levels of the cache levels.
Parameters
- statistics
- Statistics object.
Defined in MinSG/Ext/OutOfCore/CacheManager.h:144
function
MinSG::OutOfCore::CacheManager::getCacheContext
public | inline |
CacheContext & getCacheContext( | ) |
Access the associated cache context.
Defined in MinSG/Ext/OutOfCore/CacheManager.h:147