|
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) |
|
Lists provide a data structure for retrieving multiple Objects (Devices, Signals, or Maps) as a result of a query.
◆ 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
-
list | The list of objects to filter. |
property | Symbolic identifier of the property to look for. |
key | The name of the property to search for. |
length | The value length. |
type | The 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. |
value | The value. |
op | The 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
-
list | The object list to free. |
◆ mpr_list_get_cpy()
mpr_list mpr_list_get_cpy |
( |
mpr_list | list | ) |
|
Copy a previously-constructed object list.
- Parameters
-
list | The 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
-
list1 | The first object list. |
list2 | The 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
-
list | The object list to query. |
index | The 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
-
list1 | The first object list. |
list2 | The 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
-
list | The 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
-
list | The 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
-
list1 | The first object list. |
list2 | The 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
-
list | The object list to print. |