Holder class for managing items in a WSGLBufferObjectCache.
More...
#include <Rendering/OpenGL/wsglbufferobjectcacheitemptr.h>
The WSGLBufferObjectCacheItemPtr manages reference counting to internal cache objects. Once an internally cached object has no more WSGLBufferObjectCacheItemPtr's associated with it, the item becomes a candidate for expiry when the WSGLBufferObjectCache needs to free up memory.
◆ WSGLBufferObjectCacheItemPtr() [1/3]
This will create an invalid CacheItem. It is present to allow CacheItem objects to be stored in STL containers, since these containers require a default constructor to be provided. All uses of a CacheItem should never require the default constructor to actually be used though, and any attempt to do so will trigger an assertion if the module is built in debug mode.
◆ WSGLBufferObjectCacheItemPtr() [2/3]
- Parameters
-
cacheItem | The item that this ptr with reference. |
This will create a new cache object if necessary. Once an object has been obtained, its reference count will be incremented.
◆ WSGLBufferObjectCacheItemPtr() [3/3]
- Parameters
-
Internally, the const-ness of item is cast away. This is necessary because the CacheItem being constructed will share the cacheItem_ held by item and store it as a non-const pointer.
- Postcondition
- The two CacheItem instances will share the same private cacheItem_ data member (which is reference counted).
◆ ~WSGLBufferObjectCacheItemPtr()
Decrement the reference count of the cache object being held. This will place the cache object onto the expiry queue if the reference count is reduced to zero.
◆ clear()
◆ get()
◆ isValid()
◆ operator*()
◆ operator->()
◆ operator=()
- Parameters
-
Internally, the const-ness of item is cast away. This is necessary because the CacheItem being assigned to will share the cacheItem_ held by item and store it as a non-const pointer.
- Postcondition
- The two CacheItem instances will share the same private cacheItem_ data member (which is reference counted).
◆ unique()
◆ useCount()
unsigned useCount |
( |
| ) |
const |
|
noexcept |