edmiRolesOf


 

EdmiError edmiRolesOf(SdaiAppInstance instance,
                       SdaiInteger     *options,  
                       SdaiInteger     *membersInResult, 
                       void            *result); 

Implements the Express built in function RolesOf as defined in section 15.20 RolesOf – general function; in ISO 10303-11:1994(E) : The EXPRESS Language Reference Manual. This operation is only applicable on data models. The actual data model must be open before this operation can be successfully performed. Dependent of the <options> argument, each returned role will be either in the form of a fully qualified attribute (role), i.e., a string in the format: EXPRESS_SCHEMA_NAME.ENITY_NAME.ATRIBUTE_NAME or as a SdaiAttr (attributeID).

 

Arguments


TypeNameComment
SdaiAppInstance

instance

A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase. This instanceID will be the actual argument to the RolesOf function. The instanceID is defined by a sdaiCreateInstance or a sdaiCreateInstanceBN function.

SdaiInteger

options

Specifies the options to be used in the invocation of the edmiRolesOf function. The <options> value can be specified as a bitwise OR between the actual options to enable. All option names are defined on the header file sdai.h . See detailed descriptions of the available options below.

SdaiInteger

membersInResult

Address of a SdaiInteger variable that will receive the returned number of instanceID's in the resulting data set..

void

result

Address of a variable that will receive the aggregateID or address of the memory buffer that holds the resulting data set.

Return Value


Error rendering macro 'excerpt-include' : User 'null' does not have permission to view the page 'US:_r_EDMInterface'.

Options


 

OptionComment

AS_SCRATCH_AGGR

The result of the operation will be returned in a new created scratch aggregate. The scratch aggregate will be a SET OF attributeID.
A numeric aggregateID that uniquely identifies the resulting scratch aggregate instance will be returned in the <result> argument.
AS_SCRATCH_AGGR is the default value of the <options> argument.

AS_MEMORY_BUFFER

The operation result aggregate will be returned as a memory buffer in the calling application's virtual memory. The memory address (byte address) of the memory buffer will be returned in the <result> argument. The memory buffer will be an array of SdaiString or SdaiAttr. The virtual memory in the calling application's memory will be allocated by EDMinterface. This virtual memory should be released by the calling application, using the EDMinterface operation edmiFree when the data is no longer needed by the application.

AS_STRINGS

The resulting data set will be a memory buffer of SdaiString or a SET OF STRING (scratch aggregate)

AS_INSTANCE_IDS

The resulting data set will be a memory buffer of SdaiAttr or a SET OF ATTRIBUTE_DEFRINITION (scratch aggregate)

Example


 

EdmiError rstat;
 SdaiAppInstance instance;
 SdaiInteger membersInResult;
 SdaiString *result, *ps;
 . . .
 if (rstat = edmiRolesOf (instance,
 AS_STRINGS | MEMORY_BUFFER, 
 &membersInResult, 
 (void *) &result)) { 
 /* Error in operation */ 
 printf("\nError: %s in edmiRolesOf\n", 
 edmiGetErrorText(rstat)); 
 goto error; 
 }
 /* Printing out the returned (string) roles */
 ps = result;
 for (i = 0; i < membersInResult; i++) {
 printf("\n%s", *ps); 
 ++ps; 
 }
 edmiFree(result);
 . . .

 

See also

Filter by label

There are no items with the selected labels at this time.