|
size_t | size () const |
| Get the number of elements allocated in the cache. More...
|
|
size_t | capacity () const |
| Get the maximum number of elements that can be stored in the cache. More...
|
|
bool | empty () const |
| Checks whether the cache is empty. More...
|
|
bool | contains (const std::string &key) |
| Checks whether a value is already stored in the cache looking for its key. More...
|
|
void | insert (const std::string &key, WavefrontObj *value) |
| Inserts an element in the cache. More...
|
|
WavefrontObj * | get (const std::string &key) |
| Returns a cache element by its key, if exists. More...
|
|
void | deallocate () |
| Removes the last element in the list to make room to a new one. This function is called only if the cache is full.
|
|
|
map_type | m_map |
|
list_type | m_list |
|
size_t | m_capacity |
|
◆ capacity()
size_t WavefrontObjCache::capacity |
( |
| ) |
const |
Get the maximum number of elements that can be stored in the cache.
- Returns
- Number of elements that can be stored in the cache
◆ contains()
bool WavefrontObjCache::contains |
( |
const std::string & |
key | ) |
|
Checks whether a value is already stored in the cache looking for its key.
- Parameters
-
key | Key of the value to be checked |
- Returns
- True if the value exists, False otherwise
◆ empty()
bool WavefrontObjCache::empty |
( |
| ) |
const |
Checks whether the cache is empty.
- Returns
- True if the cache is empty, false otherwise
◆ get()
value_type WavefrontObjCache::get |
( |
const std::string & |
key | ) |
|
Returns a cache element by its key, if exists.
- Parameters
-
key | Key used to look for an element stored in the cache |
- Returns
- The element if found, nullptr otherwise
◆ getInstance()
Get an instance of the cache (Singleton Pattern)
- Returns
- Instance of the cache itself ready to be used.
◆ insert()
void WavefrontObjCache::insert |
( |
const std::string & |
key, |
|
|
WavefrontObj * |
value |
|
) |
| |
Inserts an element in the cache.
- Parameters
-
key | Key of the value used in future searches |
value | Element to be stored |
◆ size()
size_t WavefrontObjCache::size |
( |
| ) |
const |
Get the number of elements allocated in the cache.
- Returns
- Number of elements allocated in the cache
The documentation for this class was generated from the following files:
- src/assetloading/geometryfilter/WavefrontObjCache.h
- src/assetloading/geometryfilter/WavefrontObjCache.cpp