Returns a buffer with containerIds of all the instance containers of given type in which a given instanceId is contained.
Related functions: edmiCreateInstanceContainer, edmiDeleteInstanceContainer, edmiDeleteInstanceContainerBN, edmiEmptyContainer, edmiEmptyContainerBN, edmiGetInstanceContainerId, edmiSetContainerCheckedout, edmiSetContainerCheckedoutBN, edmiUnsetContainerCheckedout, edmiUnsetContainerCheckedoutBN, edmiInstanceToContainer, edmiInstanceToContainerBN, edmiInstancesToContainer, edmiInstancesToContainerBN.
Header:
#include "sdai.h"
Prototype:
EdmiError edmiGetInstanceContainers(SdaiAppInstance currInst,
SdaiOptions options,
SdaiContainer *containerId,
SdaiInteger *numberOfContainers,
SdaiContainer **containerIds);
Arguments:
currInst |
A numeric instanceID that uniquely identifies the instance of interest in the EDMdatabase. |
options |
Specifies what type of instance containers to search for. The option value may be a bitwise OR of any combination of the options listed below. |
containerId |
Variable that will receive the the Id of the lockable container in which the instance Id is located. No instance may be contained by more than one lockable instance container at the same time. Hence, only a single container Id may result when searcing for lockable containers. If the instance is not located in any lockable containers, this parameter will be unset. |
numberOfContainers |
The total number of instance container ids returned in the <containerIds> buffer. |
containerIds |
Variable that will receive a pointer to a buffer of container ids in which the instance given in <currInst> is located. When searching for lockable containers, the id of the container will be returned in this buffer as well as in the parameter <containerId> |
Option Description
CONTAINER |
Search for all plain instance containers. |
LOCK_CONTAINER |
Search for any lockable instance container. |
MODEL_CONTAINER |
Search for all plain instance model containers. |
MODEL_LOCK_CONTAINER |
Search for any lockable instance model container. |
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:
EdmiError rstat;
SdaiInstance instId;
SdaiContainer contId;
SdaiContainer *pConts;
. . .
if (rstat = edmiGetInstanceContainers(instId, 0,
&contId, &nCont, &pConts)) {
printf("\nError %d in edmiGetInstanceContainers: %s", rstat,
edmiGetErrorText(rstat));
goto err;
}
if (contId) {
printf("\nInstance %d is locked in container %d", instId, contId);
} else {
printf("\nInstance %d is unlocked");
}
. . .