Logo Search packages:      
Sourcecode: znc version File versions

TCacheMap< T > Class Template Reference

#include <Utils.h>

List of all members.


Detailed Description

template<typename T>
class TCacheMap< T >

Insert an object with a time-to-live and check later if it still exists.

Author:
prozac <prozac@rottenboy.com>

Definition at line 338 of file Utils.h.


Public Member Functions

void AddItem (const T &Item, unsigned int uTTL)
 This function adds an item to the cache using a custom time-to-live value.
void AddItem (const T &Item)
 This function adds an item to the cache using the default time-to-live value.
void Cleanup ()
 Cycles through the queue removing all of the stale entries.
bool HasItem (const T &Item)
 Performs a Cleanup() and then checks to see if your item exists.
bool RemItem (const T &Item)
 Removes a specific item from the cache.
void SetTTL (unsigned int u)
 TCacheMap (unsigned int uTTL=5000)

Private Attributes

map< T, unsigned long long > m_mItems
 Map of cached items. The value portion of the map is for the expire time.
unsigned int m_uTTL
 Default time-to-live duration.

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index