nrac_resource_consumers_get()
Abstract
Obtain a list of the consumers that are using a specific resource.
Syntax
nrac_resource_consumers_get (resource_handle, event_handle)
| Argument | Type | Description |
|---|---|---|
resource_handle |
Nrac_Resource_Handle |
handle for the resource of interest |
event_handle |
Nrac_Event_Handle |
handle for an event that is used to restrict the applicable consumers. Use NRAC_ANY_EVENT to return all consumers. |
Return Type
PrgT_List *
list of elements of type Nrac_Conditional_Consumer_Handle. Provides access to consumers and the events upon which they are contingent.
Header
nrac.h
Details
This function builds a list of all the consumers on a given resource. The result can be based solely on the consumers with respect to a specific event or, if NRAC_ANY_EVENT is passed in, then all consumers are taken into account, irrespective of the events upon which they depend. The list consists of elements of type Nrac_Conditional_Consumer_Handle, which provide access to both a consumer and an event upon which it is dependent.
The list of handles obtained by calling this function is not maintained by the NRAC package. Once it is returned to the calling code, it is the programmer’s responsibility to deallocate that memory, once all of the desired information had been extracted. This is most easily done by calling prg_list_free() to free the elements in the list and prg_mem_free() to free the list container object itself. Alternatively, you may deallocate one element in the list at a time by using nrac_conditional_consumer_destroy().