This file is part of SpringLobby, Copyright (C) 2007-2011. More...
#include <mru_cache.h>

Public Member Functions | |
| MostRecentlyUsedCache (int max_size, const wxString &name=_T("")) | |
| name parameter might be used to identify stats in dgb output | |
| ~MostRecentlyUsedCache () | |
| void | Add (const TKey &name, const TValue &img) |
| bool | TryGet (const TKey &name, TValue &img) |
| void | Clear () |
Private Types | |
| typedef std::pair< TKey, TValue > | CacheItem |
| typedef std::list< CacheItem > | CacheItemList |
| typedef std::map< TKey, typename CacheItemList::iterator > | IteratorMap |
Private Attributes | |
| wxCriticalSection | m_lock |
| CacheItemList | m_items |
| IteratorMap | m_iterator_map |
| int | m_size |
| const int | m_max_size |
| int | m_cache_hits |
| int | m_cache_misses |
| const wxString | m_name |
This file is part of SpringLobby, Copyright (C) 2007-2011.
SpringLobby is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
SpringLobby is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with SpringLobby. If not, see <http://www.gnu.org/licenses/>. Thread safe MRU cache (works like a std::map but has maximum size)
Definition at line 33 of file mru_cache.h.
typedef std::pair<TKey, TValue> MostRecentlyUsedCache< TKey, TValue >::CacheItem [private] |
Definition at line 88 of file mru_cache.h.
typedef std::list<CacheItem> MostRecentlyUsedCache< TKey, TValue >::CacheItemList [private] |
Definition at line 89 of file mru_cache.h.
typedef std::map<TKey, typename CacheItemList::iterator> MostRecentlyUsedCache< TKey, TValue >::IteratorMap [private] |
Definition at line 90 of file mru_cache.h.
| MostRecentlyUsedCache< TKey, TValue >::MostRecentlyUsedCache | ( | int | max_size, | |
| const wxString & | name = _T("") | |||
| ) | [inline] |
name parameter might be used to identify stats in dgb output
Definition at line 37 of file mru_cache.h.
| MostRecentlyUsedCache< TKey, TValue >::~MostRecentlyUsedCache | ( | ) | [inline] |
Definition at line 42 of file mru_cache.h.
| void MostRecentlyUsedCache< TKey, TValue >::Add | ( | const TKey & | name, | |
| const TValue & | img | |||
| ) | [inline] |
Definition at line 48 of file mru_cache.h.
| void MostRecentlyUsedCache< TKey, TValue >::Clear | ( | ) | [inline] |
Definition at line 79 of file mru_cache.h.
| bool MostRecentlyUsedCache< TKey, TValue >::TryGet | ( | const TKey & | name, | |
| TValue & | img | |||
| ) | [inline] |
Definition at line 61 of file mru_cache.h.
int MostRecentlyUsedCache< TKey, TValue >::m_cache_hits [private] |
Definition at line 97 of file mru_cache.h.
int MostRecentlyUsedCache< TKey, TValue >::m_cache_misses [private] |
Definition at line 98 of file mru_cache.h.
CacheItemList MostRecentlyUsedCache< TKey, TValue >::m_items [private] |
Definition at line 93 of file mru_cache.h.
IteratorMap MostRecentlyUsedCache< TKey, TValue >::m_iterator_map [private] |
Definition at line 94 of file mru_cache.h.
wxCriticalSection MostRecentlyUsedCache< TKey, TValue >::m_lock [mutable, private] |
Definition at line 92 of file mru_cache.h.
const int MostRecentlyUsedCache< TKey, TValue >::m_max_size [private] |
Definition at line 96 of file mru_cache.h.
const wxString MostRecentlyUsedCache< TKey, TValue >::m_name [private] |
Definition at line 99 of file mru_cache.h.
int MostRecentlyUsedCache< TKey, TValue >::m_size [private] |
Definition at line 95 of file mru_cache.h.
1.6.3