Logo Search packages:      
Sourcecode: znc version File versions

template<typename T>
void TCacheMap< T >::AddItem ( const T &  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

Definition at line 359 of file Utils.h.

                                                     {
            if (!uTTL) {                  // If time-to-live is zero we don't want to waste our time adding it
                  RemItem(Item);          // Remove the item incase it already exists
                  return;
            }

            m_mItems[Item] = CUtils::GetMillTime() + uTTL;
            Cleanup();
      }


Generated by  Doxygen 1.6.0   Back to index