ZNC trunk
Loading...
Searching...
No Matches
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.
bool HasItem (const CString &Item)
 Performs a Cleanup() and then checks to see if your item exists.
std::shared_ptr< CWebSession > * GetItem (const CString &Item)
 Performs a Cleanup() and returns a pointer to the object, or nullptr.
bool RemItem (const CString &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< CString, std::shared_ptr< CWebSession > > GetItems ()
 Returns all entries.
void SetTTL (unsigned int u)
unsigned int GetTTL () const

Protected Types

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

Protected Attributes

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

Member Typedef Documentation

◆ iterator

typedef std::map<CString,value>::iterator TCacheMap< CString, std::shared_ptr< CWebSession > >::iterator
protectedinherited

◆ value

typedef std::pair<unsigned long long, std::shared_ptr< CWebSession >> TCacheMap< CString, std::shared_ptr< CWebSession > >::value
protectedinherited

Constructor & Destructor Documentation

◆ CWebSessionMap()

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

Member Function Documentation

◆ AddItem()

void TCacheMap< CString, std::shared_ptr< 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

◆ Cleanup()

void TCacheMap< CString, std::shared_ptr< CWebSession > >::Cleanup ( )
inlineinherited

Cycles through the queue removing all of the stale entries.

◆ Clear()

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

Clear all entries.

◆ FinishUserSessions()

void CWebSessionMap::FinishUserSessions ( const CUser & User)

◆ GetItem()

std::shared_ptr< CWebSession > * TCacheMap< CString, std::shared_ptr< CWebSession > >::GetItem ( const CString & Item)
inlineinherited

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

Parameters
ItemThe item to check for
Returns
Pointer to the item or nullptr if there is no suitable one

◆ GetItems()

std::map< CString, std::shared_ptr< CWebSession > > TCacheMap< CString, std::shared_ptr< CWebSession > >::GetItems ( )
inlineinherited

Returns all entries.

◆ GetTTL()

unsigned int TCacheMap< CString, std::shared_ptr< CWebSession > >::GetTTL ( ) const
inlineinherited

◆ HasItem()

bool TCacheMap< CString, std::shared_ptr< 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

◆ RemItem()

bool TCacheMap< CString, std::shared_ptr< 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

◆ SetTTL()

void TCacheMap< CString, std::shared_ptr< CWebSession > >::SetTTL ( unsigned int u)
inlineinherited

Member Data Documentation

◆ m_mItems

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

Map of cached items.

The value portion of the map is for the expire time

◆ m_uTTL

unsigned int TCacheMap< CString, std::shared_ptr< CWebSession > >::m_uTTL
protectedinherited

Default time-to-live duration.


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