edmiGetMethodSignature

EdmiError edmiGetMethodSignature(SdaiInstance      methodId,
                                  SdaiString        *methodType,
                                  SdaiString        *methodName,
                                  SdaiString        *schemaName,
                                  SdaiString        *methodClass,
                                  SdaiInteger       *arguments,
                                  SdaiPrimitiveType *returnValueDatatype,
                                  SdaiInstance      *returnValueDomainId,
                                  SdaiString        **argumentNames,
                                  SdaiPrimitiveType **argumentDatatypes,
                                  SdaiInstance      **argumentDomainIds,
                                  SdaiString        *description,
                                  SdaiString        *textualSignature);

Reads additional information / documentation of methods in the EDMdatabase. The purpose of the user defined method signatures is to provide information about the methods and their input parameters to the users. The methods in question are Express-X mapping schemas and query functions.

Each returned arguments except  

  • SdaiInteger            *arguments,
  • SdaiPrimitiveType      *returnDatatype,
  • SdaiInstance           *returnValueDomainId,


are allocated as one block (to avoid too much memory fragmentation), and hence should be freed with one edmiFree() invocation.



Arguments


1TypeNameComment
2SdaiInstance

methodId

The instance Id of the method. This Id is an instance of the EDM_METHOD entity in the ExpressDataManager model.

3SdaiString

methodType

Variable that will receive the type of method. Values are:

  • "XPX" if the method is an Express-X Schema Map.
  • "QEX" if the method is a Query Function.
4SdaiString

methodName

Variable that will receive the name that was assigned to the method when it was defined with edmiDefineMethodSignature. If the method is a Query Function, the method name will be the name of the query function it self.

5SdaiString

schemaName

If the method is an Express-X Schema Map, this variable will receive the name of the mapping schema. If the method is a query function, the variable will receive the name of the query schema containing the query in question, qualified with the name of the parent Express schema.

6SdaiString

methodClass

Variable that will receive the optional and user defined method class. Method classification may be used to organize methods in the EDMdatabase

7SdaiInteger

arguments

This variable will receive the number of input parameters for the given method.

8SdaiPrimitiveType

returnValueDatatype

Variable that will receive the type of the return value from the method. This is only applicable for query function methods.

9SdaiInstance

returnValueDomainId

 

10SdaiString

argumentNames

A buffer that will receive a null terminated list of the input parameter names.

11SdaiPrimitiveType

argumentDatatypes

A buffer that will receive a list of the input parameter types that corresponds to the argument names in <argumentNames>

12SdaiInstance

argumentDomainIds

 

13SdaiString

description

Variable that will receive the user defined description of the method.

14SdaiString

textualSignature

Optional, method signature in text.

Return Value


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

Options


 

Example


 

EdmiError rstat;
 SdaiInteger nErr, nWrn;
 SdaiInstance xpxMethodId;
 SdaiString parNamesXpx[4] = {"Name", "Sex", "Weight", NULL};
 SdaiPrimitiveType parTypesXpx[3] = {sdaiSTRING, sdaiINTEGER, sdaiREAL};
 SdaiString type, name, schema, class, desc, *argNames;
 SdaiPrimitiveType returnType, *argTypes;
 SdaiInteger nArg;
  
 /* Define Schemas */ 
 rstat = edmiDefineSchema("c:/data/person.exp",
 "c:/temp/person.dia",  
 "Person", 0, &nWrn, &nErr); 
 rstat = edmiDefineSchemaMap("c:/data/person_maps.xpx",
 "c:/temp/person_maps.dia", 
 0, &nWrn, &nErr); 
  
 /* Define Method Signatures */ 
 /* Only applicable for "XPX" */ 
 rstat = edmiDefineMethodSignature( "XPX", "Insert a Person",
 "InsertPerson", "CLASS_INPUT", 
 parNamesXpx, parTypesXpx,  
 "Inserts a new person");  
  
 rstat = edmiGetMethodSignatureId("XPX", "Insert a Person",
 "InsertPerson", &xpxMethodId); 
  
 rstat = edmiGetMethodSignature(xpxMethodId, &type, &name, &schema,
 &class, &nArg, &returnType, &argNames, 
 &argTypes, &desc); 
  
 printf("\nMethod Id: %d", xpxMethodId);
 printf("\nMethod type : %s", strcmp(type,"XPX") ?
 "Express-X SchemaMap" : "Query Function"); 
 printf("\nMethod Name : %s", name);
 printf("\nSchema Name : %s", schema);
 printf("\nMethod Class: %s", class ? class : "Undefined";
 for (i=0; i<nArg; i++) {
 printf("\nParameter %d: %s (type %d)", i, argNames[i], argTypes[i]);
 }
 printf("\nMethod Return Type : %d", returnType);
 printf("\nMethod Description : %s", desc);

 edmiFree(xpxMethodId);
 edmiFree(argNames);
 edmiFree(argTypes);
 edmiFree(schema);
 edmiFree(returnType);

 

See also

Filter by label

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

Â