lv_cache_entry.h

Functions

uint32_t lv_cache_entry_get_size(const uint32_t node_size)

Get the size of a cache entry.

参数:

node_size -- The size of the node in the cache.

返回:

The size of the cache entry.

int32_t lv_cache_entry_get_ref(lv_cache_entry_t *entry)

Get the reference count of a cache entry.

参数:

entry -- The cache entry to get the reference count of.

返回:

The reference count of the cache entry.

uint32_t lv_cache_entry_get_node_size(lv_cache_entry_t *entry)

Get the node size of a cache entry. Which is the same size with lv_cache_entry_get_size()'s node_size parameter.

参数:

entry -- The cache entry to get the node size of.

返回:

The node size of the cache entry.

bool lv_cache_entry_is_invalid(lv_cache_entry_t *entry)

Check if a cache entry is invalid.

参数:

entry -- The cache entry to check.

返回:

True: the cache entry is invalid. False: the cache entry is valid.

void *lv_cache_entry_get_data(lv_cache_entry_t *entry)

Get the data of a cache entry.

参数:

entry -- The cache entry to get the data of.

返回:

The pointer to the data of the cache entry.

const lv_cache_t *lv_cache_entry_get_cache(const lv_cache_entry_t *entry)

Get the cache instance of a cache entry.

参数:

entry -- The cache entry to get the cache instance of.

返回:

The pointer to the cache instance of the cache entry.

lv_cache_entry_t *lv_cache_entry_get_entry(void *data, const uint32_t node_size)

Get the cache entry of a data. The data should be allocated by the cache instance.

参数:
  • data -- The data to get the cache entry of.

  • node_size -- The size of the node in the cache.

返回:

The pointer to the cache entry of the data.

lv_cache_entry_t *lv_cache_entry_alloc(const uint32_t node_size, const lv_cache_t *cache)

Allocate a cache entry.

参数:
  • node_size -- The size of the node in the cache.

  • cache -- The cache instance to allocate the cache entry from.

返回:

The pointer to the allocated cache entry.

void lv_cache_entry_init(lv_cache_entry_t *entry, const lv_cache_t *cache, const uint32_t node_size)

Initialize a cache entry.

参数:
  • entry -- The cache entry to initialize.

  • cache -- The cache instance to allocate the cache entry from.

  • node_size -- The size of the node in the cache.

void lv_cache_entry_delete(lv_cache_entry_t *entry)

Deallocate a cache entry. And the data of the cache entry will be freed.

参数:

entry -- The cache entry to deallocate.