Insert an object with a time-to-live and check later if it still exists.
More...
#include <Utils.h>
|
| | TCacheMap (unsigned int uTTL=5000) |
| |
| virtual | ~TCacheMap () |
| |
| void | AddItem (const K &Item) |
| | This function adds an item to the cache using the default time-to-live value.
|
| |
| void | AddItem (const K &Item, unsigned int uTTL) |
| | This function adds an item to the cache using a custom time-to-live value.
|
| |
| void | AddItem (const K &Item, const V &Val) |
| | This function adds an item to the cache using the default time-to-live value.
|
| |
| void | AddItem (const K &Item, const V &Val, unsigned int uTTL) |
| | This function adds an item to the cache using a custom time-to-live value.
|
| |
| bool | HasItem (const K &Item) |
| | Performs a Cleanup() and then checks to see if your item exists.
|
| |
| V * | GetItem (const K &Item) |
| | Performs a Cleanup() and returns a pointer to the object, or nullptr.
|
| |
| bool | RemItem (const K &Item) |
| | Removes a specific item from the cache.
|
| |
| void | Cleanup () |
| | Cycles through the queue removing all of the stale entries.
|
| |
| void | Clear () |
| | Clear all entries.
|
| |
| std::map< K, V > | GetItems () |
| | Returns all entries.
|
| |
| void | SetTTL (unsigned int u) |
| |
| unsigned int | GetTTL () const |
| |
|
| typedef std::pair< unsigned long long, V > | value |
| |
| typedef std::map< K, value >::iterator | iterator |
| |
|
| std::map< K, value > | m_mItems |
| | Map of cached items.
|
| |
| unsigned int | m_uTTL |
| | Default time-to-live duration.
|
| |
template<typename K, typename V = bool>
class TCacheMap< K, V >
Insert an object with a time-to-live and check later if it still exists.
- Author
- prozac proza.nosp@m.c@ro.nosp@m.ttenb.nosp@m.oy.c.nosp@m.om
◆ iterator
template<typename K , typename V = bool>
◆ value
template<typename K , typename V = bool>
| typedef std::pair<unsigned long long, V> TCacheMap< K, V >::value |
|
protected |
◆ TCacheMap()
template<typename K , typename V = bool>
◆ ~TCacheMap()
template<typename K , typename V = bool>
◆ AddItem() [1/4]
template<typename K , typename V = bool>
| void TCacheMap< K, V >::AddItem |
( |
const K & |
Item | ) |
|
|
inline |
◆ AddItem() [2/4]
template<typename K , typename V = bool>
| void TCacheMap< K, V >::AddItem |
( |
const K & |
Item, |
|
|
const V & |
Val |
|
) |
| |
|
inline |
◆ AddItem() [3/4]
template<typename K , typename V = bool>
| void TCacheMap< K, V >::AddItem |
( |
const K & |
Item, |
|
|
const V & |
Val, |
|
|
unsigned int |
uTTL |
|
) |
| |
|
inline |
◆ AddItem() [4/4]
template<typename K , typename V = bool>
| void TCacheMap< K, V >::AddItem |
( |
const K & |
Item, |
|
|
unsigned int |
uTTL |
|
) |
| |
|
inline |
◆ Cleanup()
template<typename K , typename V = bool>
◆ Clear()
template<typename K , typename V = bool>
◆ GetItem()
template<typename K , typename V = bool>
| V * TCacheMap< K, V >::GetItem |
( |
const K & |
Item | ) |
|
|
inline |
◆ GetItems()
template<typename K , typename V = bool>
| std::map< K, V > TCacheMap< K, V >::GetItems |
( |
| ) |
|
|
inline |
◆ GetTTL()
template<typename K , typename V = bool>
| unsigned int TCacheMap< K, V >::GetTTL |
( |
| ) |
const |
|
inline |
◆ HasItem()
template<typename K , typename V = bool>
| bool TCacheMap< K, V >::HasItem |
( |
const K & |
Item | ) |
|
|
inline |
◆ RemItem()
template<typename K , typename V = bool>
| bool TCacheMap< K, V >::RemItem |
( |
const K & |
Item | ) |
|
|
inline |
◆ SetTTL()
template<typename K , typename V = bool>
| void TCacheMap< K, V >::SetTTL |
( |
unsigned int |
u | ) |
|
|
inline |
◆ m_mItems
template<typename K , typename V = bool>
Map of cached items.
The value portion of the map is for the expire time
Referenced by TCacheMap< K, V >::AddItem(), TCacheMap< K, V >::Cleanup(), TCacheMap< K, V >::Clear(), TCacheMap< K, V >::GetItem(), TCacheMap< K, V >::GetItems(), TCacheMap< K, V >::HasItem(), and TCacheMap< K, V >::RemItem().
◆ m_uTTL
template<typename K , typename V = bool>
The documentation for this class was generated from the following file: