YSTest: YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc > 模板类 参考

YSTest PreAlpha_b500_20140530 The YSLib Test Project

- 首页
- 相关页面
- 模块
- 命名空间
- 类
- 文件

- 类列表
- 类索引
- 类继承关系
- 类成员

全部 类 命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 组 页
Public 类型 | Public 成员函数 | Private 属性 | 所有成员列表
YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc > 模板类 参考

按最近最多使用策略刷新的缓存。 更多...

`#include <Cache.hpp>`

类 YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc > 继承关系图:
[图例]
YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc > 的协作图:
[图例]

## Public 类型

using | Map = unordered_map< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >
using | UseList = list< _tKey, _tAlloc >
using | UseCache = unordered_multimap< _tKey, typename UseList::iterator, _fHash, _fEqual, _tAlloc >

## Public 成员函数

| GMRUCache (size_type s=15U)
| DefDeMoveCtor (GMRUCache) private
| DefGetter (const ynothrow, size_type, MaxUse, max_use) void SetMaxUse(size_type s)
void | clear () ynoexcept
template<typename... _tParams>
pair< typename Map::iterator, bool > | emplace (_tParams &&...args)
iterator | find (const key_type &k)
const_iterator | find (const key_type &k) const

## Private 属性

UseList | use_list
UseCache | use_cache
size_type | max_use
| 保持可以再增加一个缓存项的最大容量。 更多...

## 详细描述

### template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>
class YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >

按最近最多使用策略刷新的缓存。

自从
  build 461

待办事项:

  加入异常安全的复制构造函数。

  扩展为 MLU 列表。

在文件 Cache.hpp 第 48 行定义.

## 成员类型定义说明

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

using YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::Map = unordered_map<_tKey, _tMapped, _fHash, _fEqual, _tAlloc>

在文件 Cache.hpp 第 52 行定义.

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

using YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::UseCache = unordered_multimap<_tKey, typename UseList::iterator, _fHash, _fEqual, _tAlloc>

在文件 Cache.hpp 第 55 行定义.

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

using YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::UseList = list<_tKey, _tAlloc>

在文件 Cache.hpp 第 53 行定义.

## 构造及析构函数说明

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::GMRUCache | ( | size_type | s = `15U` | ) |

inlineexplicit

在文件 Cache.hpp 第 69 行定义.

## 成员函数说明

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

void YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::clear | ( |  | ) |

inline

在文件 Cache.hpp 第 105 行定义.

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::DefDeMoveCtor | ( | GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc > |  | ) |

inline

在文件 Cache.hpp 第 72 行定义.

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::DefGetter | ( | const ynothrow | ,
|  | size_type | ,
|  | MaxUse | ,
|  | max_use |
| ) |  |

inline

在文件 Cache.hpp 第 92 行定义.

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>
template<typename... _tParams>

pair<typename Map::iterator, bool> YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::emplace | ( | _tParams &&... | args | ) |

inline

在文件 Cache.hpp 第 116 行定义.

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

iterator YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::find | ( | const key_type & | k | ) |

inline

在文件 Cache.hpp 第 146 行定义.

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

const_iterator YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::find | ( | const key_type & | k | ) | const

inline

在文件 Cache.hpp 第 158 行定义.

## 类成员变量说明

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

size_type YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::max_use

private

保持可以再增加一个缓存项的最大容量。

在文件 Cache.hpp 第 65 行定义.

参考自 YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::DefDeMoveCtor().

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

UseCache YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::use_cache

private

在文件 Cache.hpp 第 63 行定义.

参考自 YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::clear(), YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::DefDeMoveCtor(), YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::emplace() , 以及 YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::find().

template<typename _tKey, typename _tMapped, typename _fHash = std::hash<_tKey>, typename _fEqual = std::equal_to<_tKey>, class _tAlloc = std::allocator<pair<const _tKey, _tMapped>>>

UseList YSLib::GMRUCache< _tKey, _tMapped, _fHash, _fEqual, _tAlloc >::use_list

mutableprivate

在文件 Cache.hpp 第 62 行定义.

参考自 YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::clear(), YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::DefDeMoveCtor(), YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::emplace() , 以及 YSLib::GMRUCache< YSLib::Drawing::Typeface::BitmapKey, YSLib::Drawing::Typeface::SmallBitmapData, YSLib::Drawing::Typeface::BitmapKeyHash >::find().

该类的文档由以下文件生成:

- Cache.hpp