summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swiften/Base/LRUCache.h')
-rw-r--r--Swiften/Base/LRUCache.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/Swiften/Base/LRUCache.h b/Swiften/Base/LRUCache.h
index e4e652f..1f92612 100644
--- a/Swiften/Base/LRUCache.h
+++ b/Swiften/Base/LRUCache.h
@@ -17,26 +17,26 @@
namespace Swift {
/**
- * The \ref LRUCache templaged class implements a lookup cache which removes
+ * The \ref LRUCache template class implements a lookup cache which removes
* the least recently used cached item from the cache, if the cache size hits
- * the \ref MAX_SIZE limit.
+ * the \p MAX_SIZE limit.
*
* An example use is a cache for entity capabilities hash to DiscoInfo.
*/
template <typename KEY_TYPE, typename VALUE_TYPE, size_t MAX_SIZE>
class LRUCache {
public:
using cacheMissFunction = std::function<boost::optional<VALUE_TYPE>(const KEY_TYPE& )>;
public:
/**
- * Inserts the key/value pair in the front of the cache. If the \ref key
+ * Inserts the key/value pair in the front of the cache. If the \p key
* already exists in the cache, it is moved to the front instead. If
- * afterwards, the cahe size exceeds the \ref MAX_SIZE limit, the least
+ * afterwards, the cahe size exceeds the \p MAX_SIZE limit, the least
* recently item is removed from the cache.
*/
void insert(const KEY_TYPE& key, VALUE_TYPE value) {
auto pushResult = cache.push_front(entry_t(key, value));
if (!pushResult.second) {
@@ -46,15 +46,15 @@ public:
cache.pop_back();
}
}
/**
- * Looks up a cache entry based on the provided \ref key and moves it back
+ * Looks up a cache entry based on the provided \p key and moves it back
* to the front of the cache. If there is no cache entry for the provided
- * \ref key, an uninitialized \ref boost::optional is returned.
- * If the optional \ref missFunction is provided, it is called on a cache miss.
- * If the \ref missFunction returns an initialized \ref boost::optional, the
+ * \p key, an uninitialized \p boost::optional is returned.
+ * If the optional \p missFunction is provided, it is called on a cache miss.
+ * If the \p missFunction returns an initialized \p boost::optional, the
* value is inserted in the cache.
*/
boost::optional<VALUE_TYPE> get(const KEY_TYPE& key, cacheMissFunction missFunction = cacheMissFunction()) {
boost::optional<VALUE_TYPE> cachedValue;
auto cacheItemIterator = boost::multi_index::get<1>(cache).find(key);