ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Types | Protected Attributes | List of all members
CWebSessionMap Class Reference

#include <WebModules.h>

+ Inheritance diagram for CWebSessionMap:
+ Collaboration diagram for CWebSessionMap:

Public Member Functions

 CWebSessionMap (unsigned int uTTL=5000)
 
void FinishUserSessions (const CUser &User)
 
void AddItem (const CString &Item)
 This function adds an item to the cache using the default time-to-live value. More...
 
void AddItem (const CString &Item, unsigned int uTTL)
 This function adds an item to the cache using a custom time-to-live value. More...
 
void AddItem (const CString &Item, const CSmartPtr< CWebSession > &Val)
 This function adds an item to the cache using the default time-to-live value. More...
 
void AddItem (const CString &Item, const CSmartPtr< CWebSession > &Val, unsigned int uTTL)
 This function adds an item to the cache using a custom time-to-live value. More...
 
bool HasItem (const CString &Item)
 Performs a Cleanup() and then checks to see if your item exists. More...
 
CSmartPtr< CWebSession > * GetItem (const CString &Item)
 Performs a Cleanup() and returns a pointer to the object, or NULL. More...
 
bool RemItem (const CString &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
 

Protected Types

typedef std::pair< unsigned
long long, CSmartPtr
< CWebSession > > 
value
 
typedef std::map< CString,
value >::iterator 
iterator
 

Protected Attributes

std::map< CString, valuem_mItems
 Map of cached items. More...
 
unsigned int m_uTTL
 Default time-to-live duration. More...
 

Member Typedef Documentation

typedef std::map<CString , value>::iterator TCacheMap< CString , CSmartPtr< CWebSession > >::iterator
protectedinherited
typedef std::pair<unsigned long long, CSmartPtr< CWebSession > > TCacheMap< CString , CSmartPtr< CWebSession > >::value
protectedinherited

Constructor & Destructor Documentation

CWebSessionMap::CWebSessionMap ( unsigned int  uTTL = 5000)
inline

Member Function Documentation

void TCacheMap< CString , CSmartPtr< CWebSession > >::AddItem ( const CString Item)
inlineinherited

This function adds an item to the cache using the default time-to-live value.

Parameters
Itemthe item to add to the cache
void TCacheMap< CString , CSmartPtr< CWebSession > >::AddItem ( const CString Item,
unsigned int  uTTL 
)
inlineinherited

This function adds an item to the cache using a custom time-to-live value.

Parameters
Itemthe item to add to the cache
uTTLthe time-to-live for this specific item
void TCacheMap< CString , CSmartPtr< CWebSession > >::AddItem ( const CString Item,
const CSmartPtr< CWebSession > &  Val 
)
inlineinherited

This function adds an item to the cache using the default time-to-live value.

Parameters
Itemthe item to add to the cache
ValThe value associated with the key Item
void TCacheMap< CString , CSmartPtr< CWebSession > >::AddItem ( const CString Item,
const CSmartPtr< CWebSession > &  Val,
unsigned int  uTTL 
)
inlineinherited

This function adds an item to the cache using a custom time-to-live value.

Parameters
Itemthe item to add to the cache
ValThe value associated with the key Item
uTTLthe time-to-live for this specific item
void TCacheMap< CString , CSmartPtr< CWebSession > >::Cleanup ( )
inlineinherited

Cycles through the queue removing all of the stale entries.

void TCacheMap< CString , CSmartPtr< CWebSession > >::Clear ( )
inlineinherited

Clear all entries.

void CWebSessionMap::FinishUserSessions ( const CUser User)
CSmartPtr< CWebSession > * TCacheMap< CString , CSmartPtr< CWebSession > >::GetItem ( const CString Item)
inlineinherited

Performs a Cleanup() and returns a pointer to the object, or NULL.

Parameters
ItemThe item to check for
Returns
Pointer to the item or NULL if there is no suitable one
unsigned int TCacheMap< CString , CSmartPtr< CWebSession > >::GetTTL ( ) const
inlineinherited
bool TCacheMap< CString , CSmartPtr< CWebSession > >::HasItem ( const CString Item)
inlineinherited

Performs a Cleanup() and then checks to see if your item exists.

Parameters
ItemThe item to check for
Returns
true if item exists
bool TCacheMap< CString , CSmartPtr< CWebSession > >::RemItem ( const CString Item)
inlineinherited

Removes a specific item from the cache.

Parameters
ItemThe item to be removed
Returns
true if item existed and was removed, false if it never existed
void TCacheMap< CString , CSmartPtr< CWebSession > >::SetTTL ( unsigned int  u)
inlineinherited

Member Data Documentation

std::map<CString , value> TCacheMap< CString , CSmartPtr< CWebSession > >::m_mItems
protectedinherited

Map of cached items.

The value portion of the map is for the expire time

unsigned int TCacheMap< CString , CSmartPtr< CWebSession > >::m_uTTL
protectedinherited

Default time-to-live duration.


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