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. More...
|
|
void | AddItem (const K &Item, unsigned int uTTL) |
| This function adds an item to the cache using a custom time-to-live value. More...
|
|
void | AddItem (const K &Item, const V &Val) |
| This function adds an item to the cache using the default time-to-live value. More...
|
|
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. More...
|
|
bool | HasItem (const K &Item) |
| Performs a Cleanup() and then checks to see if your item exists. More...
|
|
V * | GetItem (const K &Item) |
| Performs a Cleanup() and returns a pointer to the object, or NULL. More...
|
|
bool | RemItem (const K &Item) |
| Removes a specific item from the cache. More...
|
|
void | Cleanup () |
| Cycles through the queue removing all of the stale entries. More...
|
|
void | Clear () |
| Clear all entries. More...
|
|
void | SetTTL (unsigned int u) |
|
unsigned int | GetTTL () const |
|
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
template<typename K, typename V = bool>
template<typename K, typename V = bool>
template<typename K, typename V = bool>
template<typename K, typename V = bool>
template<typename K, typename V = bool>
void TCacheMap< K, V >::AddItem |
( |
const K & |
Item | ) |
|
|
inline |
template<typename K, typename V = bool>
void TCacheMap< K, V >::AddItem |
( |
const K & |
Item, |
|
|
unsigned int |
uTTL |
|
) |
| |
|
inline |
This function adds an item to the cache using a custom time-to-live value.
- Parameters
-
Item | the item to add to the cache |
uTTL | the time-to-live for this specific item |
template<typename K, typename V = bool>
void TCacheMap< K, V >::AddItem |
( |
const K & |
Item, |
|
|
const V & |
Val |
|
) |
| |
|
inline |
This function adds an item to the cache using the default time-to-live value.
- Parameters
-
Item | the item to add to the cache |
Val | The value associated with the key Item |
template<typename K, typename V = bool>
void TCacheMap< K, V >::AddItem |
( |
const K & |
Item, |
|
|
const V & |
Val, |
|
|
unsigned int |
uTTL |
|
) |
| |
|
inline |
This function adds an item to the cache using a custom time-to-live value.
- Parameters
-
Item | the item to add to the cache |
Val | The value associated with the key Item |
uTTL | the time-to-live for this specific item |
template<typename K, typename V = bool>
template<typename K, typename V = bool>
template<typename K, typename V = bool>
V* TCacheMap< K, V >::GetItem |
( |
const K & |
Item | ) |
|
|
inline |
Performs a Cleanup() and returns a pointer to the object, or NULL.
- Parameters
-
Item | The item to check for |
- Returns
- Pointer to the item or NULL if there is no suitable one
Referenced by CZNC::GetServerThrottle().
template<typename K, typename V = bool>
unsigned int TCacheMap< K, V >::GetTTL |
( |
| ) |
const |
|
inline |
template<typename K, typename V = bool>
bool TCacheMap< K, V >::HasItem |
( |
const K & |
Item | ) |
|
|
inline |
Performs a Cleanup() and then checks to see if your item exists.
- Parameters
-
Item | The item to check for |
- Returns
- true if item exists
template<typename K, typename V = bool>
bool TCacheMap< K, V >::RemItem |
( |
const K & |
Item | ) |
|
|
inline |
Removes a specific item from the cache.
- Parameters
-
Item | The item to be removed |
- Returns
- true if item existed and was removed, false if it never existed
Referenced by TCacheMap< CString >::AddItem().
template<typename K, typename V = bool>
void TCacheMap< K, V >::SetTTL |
( |
unsigned int |
u | ) |
|
|
inline |
template<typename K, typename V = bool>
template<typename K, typename V = bool>
The documentation for this class was generated from the following file: