MLT  7.24.0
Public Member Functions | Data Fields
mlt_cache_item_s Struct Reference

Cache item class. More...

Public Member Functions

void mlt_cache_item_close (mlt_cache_item item)
 Close a cache item. More...
 

Data Fields

mlt_cache cache
 a reference to the cache to which this belongs More...
 
void * data
 the opaque pointer to the cached data More...
 
mlt_destructor destructor
 a function to release or destroy the cached data More...
 
void * object
 a parent object to the cache data that uniquely identifies this cached item More...
 
int refcount
 a reference counter to control when destructor is called More...
 
int size
 the size of the cached data More...
 

Detailed Description

Cache item class.

A cache item is a structure holding information about a data object including a reference count that is used to control its lifetime. When you get a a cache item from the cache, you hold a reference that prevents the data from being released when the cache is full and something new is added. When you close the cache item, the reference count is decremented. The data object is destroyed when all cache items are closed and the cache releases its reference.

Member Function Documentation

◆ mlt_cache_item_close()

void mlt_cache_item_close ( mlt_cache_item  item)

Close a cache item.

Release a reference and call the destructor on the data object when all references are released.

Parameters
itema cache item

Field Documentation

◆ cache

mlt_cache mlt_cache_item_s::cache

a reference to the cache to which this belongs

◆ data

void* mlt_cache_item_s::data

the opaque pointer to the cached data

◆ destructor

mlt_destructor mlt_cache_item_s::destructor

a function to release or destroy the cached data

◆ object

void* mlt_cache_item_s::object

a parent object to the cache data that uniquely identifies this cached item

◆ refcount

int mlt_cache_item_s::refcount

a reference counter to control when destructor is called

◆ size

int mlt_cache_item_s::size

the size of the cached data


The documentation for this struct was generated from the following file: