libmapper  1.2
Functions
Links

Functions

mapper_device mapper_link_device (mapper_link link, int idx)
 
int mapper_link_num_maps (mapper_link link)
 
mapper_map * mapper_link_maps (mapper_link link)
 
mapper_id mapper_link_id (mapper_link link)
 
void mapper_link_set_user_data (mapper_link link, const void *user_data)
 
void * mapper_link_user_data (mapper_link link)
 
int mapper_link_num_properties (mapper_link link)
 
int mapper_link_property (mapper_link link, const char *name, int *length, char *type, const void **value)
 
int mapper_link_property_index (mapper_link link, unsigned int index, const char **name, int *length, char *type, const void **value)
 
int mapper_link_set_property (mapper_link link, const char *name, int length, char type, const void *value, int publish)
 
int mapper_link_remove_property (mapper_link link, const char *name)
 
void mapper_link_clear_staged_properties (mapper_link link)
 
void mapper_link_push (mapper_link link)
 
mapper_link * mapper_link_query_union (mapper_link *query1, mapper_link *query2)
 
mapper_link * mapper_link_query_intersection (mapper_link *query1, mapper_link *query2)
 
mapper_link * mapper_link_query_difference (mapper_link *query1, mapper_link *query2)
 
mapper_link mapper_link_query_index (mapper_link *query, int index)
 
mapper_link * mapper_link_query_next (mapper_link *query)
 
mapper_link * mapper_link_query_copy (mapper_link *query)
 
void mapper_link_query_done (mapper_link *query)
 
void mapper_link_print (mapper_link link)
 

Detailed Description

Links define network connections between pairs of devices.

Function Documentation

◆ mapper_link_clear_staged_properties()

void mapper_link_clear_staged_properties ( mapper_link  link)

Clear any staged property changes.

Parameters
linkThe link to operate on.

◆ mapper_link_device()

mapper_device mapper_link_device ( mapper_link  link,
int  idx 
)

Get the mapper_device for a specific link endpoint.

Parameters
linkThe link to check.
idxThe endpoint index, must be 0 or 1.
Returns
The endpoints's device.

◆ mapper_link_id()

mapper_id mapper_link_id ( mapper_link  link)

Get the unique id for a specific link.

Parameters
linkThe link to check.
Returns
The unique id assigned to this link.

◆ mapper_link_maps()

mapper_map* mapper_link_maps ( mapper_link  link)

Return the list of maps associated with a given link.

Parameters
linkThe link to check.
Returns
A double-pointer to the first item in the list of results. Use mapper_map_query_next() to iterate.

◆ mapper_link_num_maps()

int mapper_link_num_maps ( mapper_link  link)

Get the number of maps associated with a specific link endpoint.

Parameters
linkThe link to check.
Returns
The number of associated maps.

◆ mapper_link_num_properties()

int mapper_link_num_properties ( mapper_link  link)

Get the total number of properties for a specific link.

Parameters
linkThe link to check.
Returns
The number of properties.

◆ mapper_link_print()

void mapper_link_print ( mapper_link  link)

Helper to print the properties of a specific network link.

Parameters
linkThe link to print.

◆ mapper_link_property()

int mapper_link_property ( mapper_link  link,
const char *  name,
int *  length,
char *  type,
const void **  value 
)

Look up a link property by name.

Parameters
linkThe link to check.
nameThe name of the property to retrieve.
lengthA pointer to a location to receive the vector length of the property value. (Required.)
typeA pointer to a location to receive the type of the property value. (Required.)
valueA pointer to a location to receive the address of the property's value. (Required.)
Returns
Zero if found, otherwise non-zero.

◆ mapper_link_property_index()

int mapper_link_property_index ( mapper_link  link,
unsigned int  index,
const char **  name,
int *  length,
char *  type,
const void **  value 
)

Look up a link property by index. To iterate all properties, call this function from index=0, increasing until it returns zero.

Parameters
linkThe link to check.
indexNumerical index of a map property.
nameAddress of a string pointer to receive the name of indexed property. May be zero.
lengthA pointer to a location to receive the vector length of the property value. (Required.)
typeA pointer to a location to receive the type of the property value. (Required.)
valueA pointer to a location to receive the address of the property's value. (Required.)
Returns
Zero if found, otherwise non-zero.

◆ mapper_link_push()

void mapper_link_push ( mapper_link  link)

Push any property changes out to the network.

Parameters
linkThe link to operate on.

◆ mapper_link_query_copy()

mapper_link* mapper_link_query_copy ( mapper_link *  query)

Copy a previously-constructed link query.

Parameters
queryThe previous link record pointer.
Returns
A double-pointer to the copy of the list, or zero if none. Use mapper_link_query_next() to iterate.

◆ mapper_link_query_difference()

mapper_link* mapper_link_query_difference ( mapper_link *  query1,
mapper_link *  query2 
)

Get the difference between two link queries (links matching query1 but NOT query2).

Parameters
query1The first link query.
query2The second link query.
Returns
A double-pointer to the first item in a list of results. Use mapper_link_query_next() to iterate.

◆ mapper_link_query_done()

void mapper_link_query_done ( mapper_link *  query)

Given a link record pointer returned from a previous link query, indicate that we are done iterating.

Parameters
queryThe previous link record pointer.

◆ mapper_link_query_index()

mapper_link mapper_link_query_index ( mapper_link *  query,
int  index 
)

Given a link record pointer returned from a previous link query, get an indexed item in the list.

Parameters
queryThe previous link record pointer.
indexThe index of the list element to retrieve.
Returns
A pointer to the link record, or zero if it doesn't exist.

◆ mapper_link_query_intersection()

mapper_link* mapper_link_query_intersection ( mapper_link *  query1,
mapper_link *  query2 
)

Get the intersection of two link queries (links matching query1 AND query2).

Parameters
query1The first link query.
query2The second link query.
Returns
A double-pointer to the first item in a list of results. Use mapper_link_query_next() to iterate.

◆ mapper_link_query_next()

mapper_link* mapper_link_query_next ( mapper_link *  query)

Given a link record pointer returned from a previous link query, get the next item in the list.

Parameters
queryThe previous link record pointer.
Returns
A double-pointer to the next link record in the list, or zero if no more maps.

◆ mapper_link_query_union()

mapper_link* mapper_link_query_union ( mapper_link *  query1,
mapper_link *  query2 
)

Get the union of two link queries (link matching query1 OR query2).

Parameters
query1The first link query.
query2The second link query.
Returns
A double-pointer to the first item in a list of results. Use mapper_link_query_next() to iterate.

◆ mapper_link_remove_property()

int mapper_link_remove_property ( mapper_link  link,
const char *  name 
)

Remove a property of a link.

Parameters
linkThe link to operate on.
nameThe name of the property to remove.
Returns
1 if property has been removed, 0 otherwise.

◆ mapper_link_set_property()

int mapper_link_set_property ( mapper_link  link,
const char *  name,
int  length,
char  type,
const void *  value,
int  publish 
)

Set an arbitrary property for a specific link. Changes to remote links will not take effect until synchronized with the network using mapper_link_push().

Parameters
linkThe link to modify.
nameThe name of the property to add.
lengthThe length of value array.
typeThe property datatype.
valueAn array of property values.
publish1 to publish property to network, 0 for local-only.
Returns
1 if property has been changed, 0 otherwise.

◆ mapper_link_set_user_data()

void mapper_link_set_user_data ( mapper_link  link,
const void *  user_data 
)

Associate a link with an arbitrary pointer.

Parameters
linkThe link to operate on.
user_dataA pointer to user data to be associated.

◆ mapper_link_user_data()

void* mapper_link_user_data ( mapper_link  link)

Retrieve the arbitrary pointer associated with a link.

Parameters
linkThe link to operate on.
Returns
A pointer associated with this link.