Apollo 10.0
自动驾驶开放平台
|
The data structure of the LRUCache. 更多...
#include <base_map_cache.h>
Public 类型 | |
using | DestroyFunc = std::function< bool(Element *)> |
Public 成员函数 | |
MapNodeCache (unsigned int capacity, const DestroyFunc &destroy_func) | |
The constructor. | |
~MapNodeCache () | |
The destructor. | |
bool | Get (const Key &key, Element **value) |
Find element for key if it exists in the cache. | |
bool | GetSilent (const Key &key, Element **value) |
Find element for key if it exists in the cache. | |
Element * | Put (const Key &key, Element *value) |
Caches element for key. | |
Element * | Remove (const Key &key) |
Remove element for key. | |
Element * | ClearOne () |
Remove the Least Recently Used element in the cache. | |
bool | IsExist (const Key &key) |
Find element for key in the cache. | |
bool | ChangeCapacity (int capacity) |
Change cache's max capacity. | |
unsigned int | Size () |
return cache's in use. | |
unsigned | Capacity () |
return cache's max capacity. | |
静态 Public 成员函数 | |
static bool | CacheL1Destroy (Element *value) |
static bool | CacheL2Destroy (Element *value) |
The data structure of the LRUCache.
在文件 base_map_cache.h 第 33 行定义.
using apollo::localization::msf::MapNodeCache< Key, Element, MapLRUCache >::DestroyFunc = std::function<bool(Element*)> |
在文件 base_map_cache.h 第 35 行定义.
|
inline |
The constructor.
在文件 base_map_cache.h 第 46 行定义.
|
inline |
|
inlinestatic |
在文件 base_map_cache.h 第 36 行定义.
|
inlinestatic |
在文件 base_map_cache.h 第 40 行定义.
|
inline |
|
inline |
Change cache's max capacity.
New capacity must be larger than size in use.
在文件 base_map_cache.h 第 73 行定义.
Element * apollo::localization::msf::MapNodeCache< Key, Element, MapLRUCache >::ClearOne | ( | ) |
Remove the Least Recently Used element in the cache.
return the removed element or null.
在文件 base_map_cache.h 第 155 行定义.
bool apollo::localization::msf::MapNodeCache< Key, Element, MapLRUCache >::Get | ( | const Key & | key, |
Element ** | value | ||
) |
Find element for key if it exists in the cache.
If not exist, return false.
在文件 base_map_cache.h 第 91 行定义.
bool apollo::localization::msf::MapNodeCache< Key, Element, MapLRUCache >::GetSilent | ( | const Key & | key, |
Element ** | value | ||
) |
Find element for key if it exists in the cache.
If not exist, return false. This function is thread safe, but don't change position of element in LRU queue.
在文件 base_map_cache.h 第 102 行定义.
bool apollo::localization::msf::MapNodeCache< Key, Element, MapLRUCache >::IsExist | ( | const Key & | key | ) |
Find element for key in the cache.
If it exists, move it to the head of queue.
在文件 base_map_cache.h 第 176 行定义.
Element * apollo::localization::msf::MapNodeCache< Key, Element, MapLRUCache >::Put | ( | const Key & | key, |
Element * | value | ||
) |
Caches element for key.
If cache is full, return the removed element, otherwise return null.
在文件 base_map_cache.h 第 113 行定义.
Element * apollo::localization::msf::MapNodeCache< Key, Element, MapLRUCache >::Remove | ( | const Key & | key | ) |
Remove element for key.
if it exist in the cache, return the element, otherwise return null.
在文件 base_map_cache.h 第 145 行定义.
|
inline |