Synopsis
int OMlink_objs(
OMobj_id input_object,
OMobj_id output_object);
int OMinsert_link_objs(
OMobj_id input_object,
int index,
OMobj_id output_object)
Description
These routines are alternatives to the routines OMadd_obj_ref and OMinsert_obj_ref for making a connection between two objects. OMlink_objs is the routine used by the Network Editor to make connections. It makes the connection symbolically by creating a name-link object to maintain the connection. The intermediate name-link object has slightly more overhead but is useful in two situations.
If you are making the connection to a subobject of a group with reference mode by-reference (i.e., &), the name-link object makes the destination of the connection the subobject of the reference's value and automatically relinks the connection as the group reference's value changes. For example, if you have the V code
group &ref {
int a;
} => val;
group val {
int a;
};
and you use the OMlink_objs function with the output_object set to ref.a, the connection's value becomes val.a. As the ref object's value changes, so does the value of the connection.
If you are making a connection to a subobject of an array of group objects, the name-link object allows that connection to form an array of connections to the appropriate subobjects of the array of groups. For example, if you have the V code
group arr[3] {
int a;
};
int input[3];
and you use the OMlink_objs function with input_object set to input and output_object set to arr, this forms an array of connections so that effectively input[0] is set to arr[0].a, input[1] is set to arr[1].a, and so on.
OMinsert_link_objs is the same as OMlink_objs but allows you to insert connections rather than just appending them onto the end of the list. This is useful when the order of the connections is important.
Arguments
input_object
The source end of the connection.
output_object
The destination end of the connection.
index
The index of the new value in the list of connections. The existing connections are moved ahead in the list.
Returned value
The status code (see Return Status )
See also