getInstances

Retrieves the list of instances available in the SCM.

int getInstances(Descriptor** records, int* numRecords, void** params, 
                 void*** customReturn, char filter[256], 
                 char error[256])
Variable Function Description
Descriptor** records Output This is allocated and filled with the IDs and names of the available instances.
int* numRecords Output The number of records that have been allocated and returned.
void** params Input Pointer to an array of custom parameters (see Handling custom parameters and return values).
void*** customReturn Output Used to reference an array of custom return values (see Handling custom parameters and return values).
char filter[256] Input This can be passed from the client to filter out sets of instances.
char error[256] Output If an error occurs, this should be filled with a description of the error.

Operation:

  1. Query the SCM for its list of instances, possibly applying a filter.
  2. Allocate the records array. If developing a RAM in C, use the following code:
    *records = (Descriptor*) malloc(sizeof(Descriptor) * *numRecords);
  3. Fill the records array with the IDs and names.

If it is not possible to query the SCM for instances, it may be useful to have the client pass in a list of known instances using the filter buffer. The RAM should then check the list and return the instances in the records array. The instances can be hard-coded if they are constant for the SCM.