Returns the current open mode, i.e. the current access rights to the specified model.
The possible returned values are:
sdaiRO - model open for read only access.
sdaiRW - model open for read and write access.
sdaiNOACCESS - model is closed, no access to the model is permitted.
Related functions: edmiGetModelOpenModeBN , sdaiOpenModel , sdaiOpenModelBN , sdaiCloseModel .
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetModelOpenMode(SdaiModel model,
SdaiAccessMode *mode);
Arguments:
model |
A numeric modelID that uniquely identifies the model of interest in the EDMdatabase. |
mode |
Address of the variable that will receive the current open mode of the specified model. |
Returns:
A completion code of datatype EdmiError is the returned function value. The completion code has the following values:
Completion code = 0 : Operation successfully performed.
Completion code != 0: Error in operation. Completion code is an EDMinterface error code. Use edmiGetErrorText to get the error text corresponding to the error code.
EXAMPLE
SdaiModel model;
SdaiAccessMode mode;
EdmiError rstat;
. . .
if (rstat = edmiGetModelOpenMode(model, &mode)) {
/* Error in operation */
printf("\nError: %s in edmiGetModelOpenMode\n",
edmiGetErrorText(rstat));
goto error;
}
switch (mode) {
case sdaiRO:
. . . /* READ ONLY access */
break;
case sdaiRW:
. . . /* READ and WRITE access */
break;
case sdaiNOACCESS:
. . . /* No access, i.e., model is closed */
break;
default:
/* unknown value */
}
. . .