edmiGetMethodSignatureBN
EdmiError edmiGetMethodSignatureBN(SdaiString methodType, SdaiString methodName, SdaiString schemaName, SdaiInstance *methodId, 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 | SdaiString | methodType |
|
3 | SdaiString | methodName | If the method is an Express-X Schema Map, this shall be the method name that was assigned to the method when it was defined with edmiDefineMethodSignature. If the method is a query function, the method name shall be the name of the query function it self. |
4 | SdaiString | schemaName | If the method is an Express-X Schema Map, this variable shall be the name of the mapping schema. E.g "MySchemaMap". If the method is a query function, this variable shall be the name of the query schema containing the query in question, qualified with the name of the parent Express schema. |
5 | SdaiInstance | methodId | Variable that will receive the instance Id of the method. This is an instance of the EDM_METHOD entity in the ExpressDataManager model |
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, nArg; SdaiInstance xpxMethodId; SdaiString parNamesXpx[4] = {"Name", "Sex", "Weight", NULL}; SdaiPrimitiveType parTypesXpx[3] = {sdaiSTRING, sdaiINTEGER, sdaiREAL}; SdaiString class, desc, *argNames; SdaiPrimitiveType returnType, *argTypes; /* 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 = edmiGetMethodSignatureBN("XPX", "Insert a Person", "InsertPerson", &xpxMethodId, &class, &nArg, &returnType, &argNames, &argTypes, &desc); printf("\nMethod Id: %d", xpxMethodId); 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(returnType); edmiFree(desc);
Â
See also
Filter by label
There are no items with the selected labels at this time.
Â