libmapper 2.4.12
Lists

Functions

mpr_list mpr_list_filter (mpr_list list, mpr_prop property, const char *key, int length, mpr_type type, const void *value, mpr_op op)
 
mpr_list mpr_list_get_union (mpr_list list1, mpr_list list2)
 
mpr_list mpr_list_get_isect (mpr_list list1, mpr_list list2)
 
mpr_list mpr_list_get_diff (mpr_list list1, mpr_list list2)
 
mpr_obj mpr_list_get_idx (mpr_list list, unsigned int index)
 
mpr_list mpr_list_get_next (mpr_list list)
 
mpr_list mpr_list_get_cpy (mpr_list list)
 
void mpr_list_free (mpr_list list)
 
int mpr_list_get_size (mpr_list list)
 
void mpr_list_print (mpr_list list)
 

Detailed Description

Lists provide a data structure for retrieving multiple Objects (Devices, Signals, or Maps) as a result of a query.

Function Documentation

◆ mpr_list_filter()

mpr_list mpr_list_filter ( mpr_list list,
mpr_prop property,
const char * key,
int length,
mpr_type type,
const void * value,
mpr_op op )

Filter a list of objects using the given property.

Parameters
listThe list of objects to filter.
propertySymbolic identifier of the property to look for.
keyThe name of the property to search for.
lengthThe value length.
typeThe value type. Comparisons for object types (MPR_OBJ, MPR_DEV, etc.) are performed using the object id and therefore should only be used when filtering registered objects (e.g. remote objects stored in the graph or local objects that have completed registration). This means that duplicate representations of the same object stored in different graphs will be equal. If comparison of local object representations is desired use the MPR_PTR type instead.
valueThe value.
opThe comparison operator.
Returns
A list of results. Use mpr_list_get_next() to iterate.

◆ mpr_list_free()

void mpr_list_free ( mpr_list list)

Given an object list returned from a previous object query, indicate that we are done iterating.

Parameters
listThe object list to free.

◆ mpr_list_get_cpy()

mpr_list mpr_list_get_cpy ( mpr_list list)

Copy a previously-constructed object list.

Parameters
listThe object list to copy.
Returns
A copy of the initial list. Use mpr_list_get_next() to iterate.

◆ mpr_list_get_diff()

mpr_list mpr_list_get_diff ( mpr_list list1,
mpr_list list2 )

Get the difference between two object lists (objects in list1 but NOT list2).

Parameters
list1The first object list.
list2The second object list.
Returns
A list of results. Use mpr_list_get_next() to iterate.

◆ mpr_list_get_idx()

mpr_obj mpr_list_get_idx ( mpr_list list,
unsigned int index )

Get an indexed item in a list of objects.

Parameters
listThe object list to query.
indexThe index of the list element to retrieve.
Returns
A pointer to the object record, or zero if it doesn't exist.

◆ mpr_list_get_isect()

mpr_list mpr_list_get_isect ( mpr_list list1,
mpr_list list2 )

Get the intersection of two object lists (objects matching list1 AND list2).

Parameters
list1The first object list.
list2The second object list.
Returns
A list of results. Use mpr_list_get_next() to iterate.

◆ mpr_list_get_next()

mpr_list mpr_list_get_next ( mpr_list list)

Given an object list returned from a previous object query, get the next item.

Parameters
listThe object list to query.
Returns
A list of results. Use mpr_list_get_next() to iterate.

◆ mpr_list_get_size()

int mpr_list_get_size ( mpr_list list)

Return the number of objects in a previous object query list.

Parameters
listThe object list to query.
Returns
The number of objects in the list.

◆ mpr_list_get_union()

mpr_list mpr_list_get_union ( mpr_list list1,
mpr_list list2 )

Get the union of two object lists (objects matching list1 OR list2).

Parameters
list1The first object list.
list2The second object list.
Returns
A list of results. Use mpr_list_get_next() to iterate.

◆ mpr_list_print()

void mpr_list_print ( mpr_list list)

Print the contents of an object list returned from a previous object query.

Parameters
listThe object list to print.