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
1 | Type | Name | Comment |
2 | SdaiInstance | methodId | The instance Id of the method. This Id is an instance of the EDM_METHOD entity in the ExpressDataManager model. |
3 | SdaiString | methodType | Variable that will receive the type of method. Values are:
|
4 | SdaiString | 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. |
5 | SdaiString | 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. |
6 | SdaiString | methodClass | Variable that will receive the optional and user defined method class. Method classification may be used to organize methods in the EDMdatabase |
7 | SdaiInteger | arguments | This variable will receive the number of input parameters for the given method. |
8 | SdaiPrimitiveType | returnValueDatatype | Variable that will receive the type of the return value from the method. This is only applicable for query function methods. |
9 | SdaiInstance | returnValueDomainId | Â |
10 | SdaiString | argumentNames | A buffer that will receive a null terminated list of the input parameter names. |
11 | SdaiPrimitiveType | argumentDatatypes | A buffer that will receive a list of the input parameter types that corresponds to the argument names in <argumentNames> |
12 | SdaiInstance | argumentDomainIds | Â |
13 | SdaiString | description | Variable that will receive the user defined description of the method. |
14 | SdaiString | textualSignature | Optional, method signature in text. |
Return Value
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.
Â