openTRI 0.1
Functions
Refcount

Functions

triVoid triRefcountCreate (const triChar *id, triVoid *data)
 Create a new refcount. More...
 
triVoid * triRefcountRetain (const triChar *id)
 Retain a refcount. More...
 
triVoid * triRefcountRetainPtr (const triVoid *ptr)
 Retain a refcounted pointer. More...
 
triS32 triRefcountRelease (const triVoid *data)
 Release a refcount. More...
 

Detailed Description

Function Documentation

◆ triRefcountCreate()

triVoid triRefcountCreate ( const triChar *  id,
triVoid *  data 
)

Create a new refcount.

Call this after triRefcountRetain returned 0.

Parameters
id- string identifying the refcount
data- pointer to assign to the id

◆ triRefcountRetain()

triVoid * triRefcountRetain ( const triChar *  id)

Retain a refcount.

Call this to check if the data assigned to id is already in list.

Parameters
id- string identifying the refcount
Returns
Pointer to data assigned to refcount or 0 if id not in list

◆ triRefcountRetainPtr()

triVoid * triRefcountRetainPtr ( const triVoid *  ptr)

Retain a refcounted pointer.

Call this to check if the data is already in list.

Parameters
ptr- Pointer to data to check
Returns
Pointer to data assigned to refcount or 0 if ptr not in list

◆ triRefcountRelease()

triS32 triRefcountRelease ( const triVoid *  data)

Release a refcount.

Call this to release a refcount matching the data.

Parameters
data- Data to release the refcount from
Returns
0 if the data is not referred to any more and can be freed safely