sdaiGetAttrs
Returns the data value of the specified attributes in the actual instance. The actual instance is specified by a numeric instanceID that uniquely identifies an instance in the EDMdatabase. The number of attribute values to read in the operation has to be specified.
For each attribute value to read the following three arguments have to be specified:
- <attributeID> : A numeric attributeID that uniquely identifies an attribute definition instance in the EDMdatabase.
- <valueType> : The specified primitive type <valueType> must be the same as the actual data type of the attribute value or a compatible data type. The primitive type sdaiSELECT can be used to get all data types. The primitive type sdaiADB can be used to get all data types except typed value. The primitive type sdaiINTEGER is compatible with sdaiREAL, and sdaiBOOLEAN is compatible with sdaiLOGICAL, hence conversion between these compatible data types will be performed when required.
- <value> : The variable that will hold a copy of the data value read from the actual attribute. The type of <value> must be the same or a compatible type of <valueType>.
The model that holds the actual instance must be open before this function can be successfully performed.
Related functions: sdaiGetAttr , sdaiGetAttrBN , sdaiGetAttrsBN
Header:
#include "sdai.h"
Prototype:
void sdaiGetAttrs(SdaiInstance instance,
SdaiInteger numberAttrs,
...);
Arguments:
instance |
A numeric instanceID that uniquely identifies an instance in the EDMdatabase. |
numberAttrs |
An integer number that specifies the number of attribute values to read in the operation. |
values |
For each attribute value the three following arguments in the following order have to be specified:
|
Returns:
Void – use sdaiErrorQuery to check for error during operation.
Examples:
SdaiInstance instanceId;
SdaiAttr attr1_defID, attr2_defID, attr3_defID;
SdaiString mystring;
SdaiReal myreal;
SdaiBoolean mybool;
SdaiInteger myint,anotherint;
SdaiErrorCode errCode;
...
sdaiGetAttrs(instanceId, 2,
attr1_defID, sdaiSTRING, &mystring,
attr2_defID, sdaiREAL, &myreal);
if (errCode = sdaiErrorQuery()) {
/* Error in operation */
printf("\nError: %s in sdaiGetAttrs \n",
edmiGetErrorText(errCode));
goto error;
}
sdaiGetAttrs(instanceId, 3,
attr1_defID, sdaiBOOLEAN, &mybool,
attr2_defID, sdaiINTEGER, &myint,
attr3_defID, sdaiINTEGER, &anotherint);
...