# lv_cache_entry.h (/api/private/misc/cache/lv_cache_entry_h)



<RelatedHeaders name="lv_cache_entry_private.h" isPrivate="false" />

<ApiSummary functions="6" />

Functions [#functions]

<ApiTabs items="[&#x22;Getters (5)&#x22;,&#x22;Other (1)&#x22;]">
  <ApiTab value="Getters (5)">
    <ApiMember kind="function" name="lv_cache_entry_get_size" file="private/misc/cache/lv_cache_entry.h" line="37" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/cache/lv_cache_entry.h#L37">
      lv_cache_entry_get_size [#lv_cache_entry_get_size]

      Get the size of a cache entry.

      ```c title=" " lineNumbers=1
      uint32_t lv_cache_entry_get_size(const uint32_t node_size)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type             | Description                        |
      | ----------- | ---------------- | ---------------------------------- |
      | `node_size` | `const uint32_t` | The size of the node in the cache. |

      **Returns:** `uint32_t` — The size of the cache entry.
    </ApiMember>

    <ApiMember kind="function" name="lv_cache_entry_get_ref" file="private/misc/cache/lv_cache_entry.h" line="44" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/cache/lv_cache_entry.h#L44">
      lv_cache_entry_get_ref [#lv_cache_entry_get_ref]

      Get the reference count of a cache entry.

      ```c title=" " lineNumbers=1
      int32_t lv_cache_entry_get_ref(lv_cache_entry_t *entry)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                             | Description                                    |
      | ------- | ---------------------------------------------------------------- | ---------------------------------------------- |
      | `entry` | <ApiLink name="lv_cache_entry_t" display="lv_cache_entry_t *" /> | The cache entry to get the reference count of. |

      **Returns:** `int32_t` — The reference count of the cache entry.
    </ApiMember>

    <ApiMember kind="function" name="lv_cache_entry_get_node_size" file="private/misc/cache/lv_cache_entry.h" line="51" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/cache/lv_cache_entry.h#L51">
      lv_cache_entry_get_node_size [#lv_cache_entry_get_node_size]

      Get the node size of a cache entry. Which is the same size with <ApiLink name="lv_cache_entry_get_size" display="lv_cache_entry_get_size()" />'s node\_size parameter.

      ```c title=" " lineNumbers=1
      uint32_t lv_cache_entry_get_node_size(lv_cache_entry_t *entry)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                             | Description                              |
      | ------- | ---------------------------------------------------------------- | ---------------------------------------- |
      | `entry` | <ApiLink name="lv_cache_entry_t" display="lv_cache_entry_t *" /> | The cache entry to get the node size of. |

      **Returns:** `uint32_t` — The node size of the cache entry.
    </ApiMember>

    <ApiMember kind="function" name="lv_cache_entry_get_data" file="private/misc/cache/lv_cache_entry.h" line="65" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/cache/lv_cache_entry.h#L65">
      lv_cache_entry_get_data [#lv_cache_entry_get_data]

      Get the data of a cache entry.

      ```c title=" " lineNumbers=1
      void * lv_cache_entry_get_data(lv_cache_entry_t *entry)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                             | Description                         |
      | ------- | ---------------------------------------------------------------- | ----------------------------------- |
      | `entry` | <ApiLink name="lv_cache_entry_t" display="lv_cache_entry_t *" /> | The cache entry to get the data of. |

      **Returns:** `void *` — The pointer to the data of the cache entry.
    </ApiMember>

    <ApiMember kind="function" name="lv_cache_entry_get_entry" file="private/misc/cache/lv_cache_entry.h" line="73" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/cache/lv_cache_entry.h#L73">
      lv_cache_entry_get_entry [#lv_cache_entry_get_entry]

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

      ```c title=" " lineNumbers=1
      lv_cache_entry_t * lv_cache_entry_get_entry(void *data, const uint32_t node_size)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name        | Type             | Description                         |
      | ----------- | ---------------- | ----------------------------------- |
      | `data`      | `void *`         | The data to get the cache entry of. |
      | `node_size` | `const uint32_t` | The size of the node in the cache.  |

      **Returns:** <ApiLink name="lv_cache_entry_t" display="lv_cache_entry_t *" /> — The pointer to the cache entry of the data.
    </ApiMember>
  </ApiTab>

  <ApiTab value="Other (1)">
    <ApiMember kind="function" name="lv_cache_entry_is_invalid" file="private/misc/cache/lv_cache_entry.h" line="58" url="https://github.com/lvgl/lvgl/tree/e1a0ad863f29742359bc680d6a7d973448ec2285/src/misc/cache/lv_cache_entry.h#L58">
      lv_cache_entry_is_invalid [#lv_cache_entry_is_invalid]

      Check if a cache entry is invalid.

      ```c title=" " lineNumbers=1
      bool lv_cache_entry_is_invalid(lv_cache_entry_t *entry)
      ```

      <span className="sr-only">
        Parameters
      </span>

      | Name    | Type                                                             | Description               |
      | ------- | ---------------------------------------------------------------- | ------------------------- |
      | `entry` | <ApiLink name="lv_cache_entry_t" display="lv_cache_entry_t *" /> | The cache entry to check. |

      **Returns:** `bool` — True: the cache entry is invalid. False: the cache entry is valid.
    </ApiMember>
  </ApiTab>
</ApiTabs>

Dependencies [#dependencies]

<FileIncludes includes="[&#x22;lv_cache.h&#x22;]" includedBy="[&#x22;lv_draw_private.h&#x22;, &#x22;lv_vg_lite_stroke.h&#x22;, &#x22;lvgl_private.h&#x22;, &#x22;lv_cache_entry_private.h&#x22;]" transitiveIncludes="[&#x22;lv_cache_class.h&#x22;, &#x22;lv_cache_lru_ll.h&#x22;, &#x22;lv_cache_lru_rb.h&#x22;, &#x22;lv_cache_sc_da.h&#x22;, &#x22;lv_image_cache.h&#x22;, &#x22;lv_iter_private.h&#x22;, &#x22;lv_os_private.h&#x22;]" />
