edmiRemoteIsSubtypeOf

EdmiError edmiRemoteIsSubtypeOf(SdaiServerContext serverContextId,
                                  SdaiEntity        subtypeEntityId,
                                  SdaiEntity        supertypeEntityId,
                                  SdaiBoolean       *isSubtypeOf,
                                  SdaiInvocationId  *edmiInvocationId);


Determines whether a specified instance type is a subtype of another specified instance type. This operation will return sdaiTRUE if the instance type specified by the <subtypeEntity> argument is the same or a subtype of the instance type specified by the <supertypeEntity> argument, else sdaiFALSE will be returned.

Arguments


TypeNameComment
SdaiServerContext

serverContextId

Context identification, from edmiDefineServerContext

SdaiEntity

subtypeEntityId

The numeric entityID that uniquely identifies the assumed entity subtype within the the remote  EDMdatabase

SdaiEntity

supertypeEntityId

The numeric entityID that uniquely identifies the assumed entity supertype within the the remote EDMdatabase

SdaiBoolean

isSubtypeOf

A variable that will receive sdaiTRUE if the entity <subtypeEntityId> is a subtype of the entity <supertypeEntityId>.

SdaiInvocationId

edmiInvocationId

Currently not used.

 

Return Value


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

 

Options


  

 

Example


 

 /*
 SCHEMA Relations 
 ENTITY Person; 
 PID : INTEGER; 
 Name : STRING; 
 END_ENTITY; 
  
 ENTITY Man SUBTYPE OF Person; 
 . . . 
 HasBeard : BOOLEAN; 
 . . . 
 END_ENTITY; 
  
 ENTITY Woman SUBTYPE OF Person; 
 . . . 
 HasGivenBirth : BOOLEAN; 
 . . . 
 END_ENTITY; 
 END_SCHEMA; 
 */
 EdmiError rstat;
 SdaiInteger nWrn, nErr;
 SdaiServerContext myContext;
 SdaiEntity manEID, personEID;
 SdaiBoolean isSubType;
 SdaiModel modelId;
  
 /* Define Remote Server Context */
 rstat = edmiDefineServerContext("MyRemoteServerContext",
 "Johnny", "Supervisor", "cf37ftr", 
 "TCP", "9090", "MyServerHost", 
 NULL, NULL, NULL, NULL, NULL, &myContext); 
  
 /* Compile the schema */
 rstat = edmiRemoteDefineSchema(myContext, EXPRESS_SCHEMA_TYPE,
 "c:/data/Relations.exp", "c:/tmp/Relations.dia",  
 "Relations", 0, &nWrn, &nErr, NULL); 
  
 /* Create the MyRelations model */
 rstat = edmiRemoteCreateModel(myContext, "JohnnysRepository",
 "MyRelations", "Relations", 0, NULL); 
  
 /* Get the model Id */
 rstat = edmiRemoteGetModelBN(myContext, "JohnnysRepository",
 "MyRelations", &modelId, NULL); 
  
 /* Get Man entity Id */
 rstat = edmiRemoteGetEntity(myContext, modelId,
 "Man", &manEID, NULL);
  
 /* Get Person entity Id */
 rstat = edmiRemoteGetEntity(myContext, modelId,
 "Person", &personEID, NULL);
  
 /* Is man subtype of person? */
 rstat = edmiRemoteIsSubtypeOf(myContext,
 manEID, personEID, &isSubType, NULL); 
  
 printf("\nMan is%s subtype of person",
 isSubType ? "" : "n't"); 
 . . .

 

See also

Filter by label

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

Â