List object.
More...
Detailed Description
This section documents the list object of the GPAC framework.
Function Documentation
Constructs a new list object
- Returns:
- new list object
Destructs a list object
- Parameters:
-
ptr | list object to destruct |
- Note:
- It is the caller responsability to destroy the content of the list if needed
Returns number of items in the list
- Parameters:
-
- Returns:
- number of items in the list
Adds an item at the end of the list
- Parameters:
-
ptr | target list object |
item | item to add |
Insert an item in the list
- Parameters:
-
ptr | target list object |
item | item to add |
position | insertion position. It is expressed between 0 and gf_list_count-1, and any bigger value is equivalent to gf_list_add |
Removes an item from the list given its position
- Parameters:
-
ptr | target list object |
position | position of the item to remove. It is expressed between 0 and gf_list_count-1. |
- Note:
- It is the caller responsability to destroy the content of the list if needed
Gets an item from the list given its position
- Parameters:
-
ptr | target list object |
position | position of the item to get. It is expressed between 0 and gf_list_count-1. |
Finds an item in the list
- Parameters:
-
ptr | target list object. |
item | the item to find. |
- Returns:
- 0-based item position in the list, or -1 if the item could not be found.
Deletes an item from the list
- Parameters:
-
ptr | target list object. |
item | the item to find. |
- Returns:
- 0-based item position in the list before removal, or -1 if the item could not be found.
Resets the content of the list
- Parameters:
-
- Note:
- It is the caller responsability to destroy the content of the list if needed
Gets last item o fthe list
- Parameters:
-
Removes the last item of the list
- Parameters:
-
- Note:
- It is the caller responsability to destroy the content of the list if needed
Retrieves given list item and increment current position
- Parameters:
-
ptr | target list object |
pos | target item position. The position is automatically incremented regardless of the return value |
- Note:
- A typical enumeration will start with a value of 0 until NULL is returned.