sdaiGetAttrsBN


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 has to be specified.
For each attribute value to read the following three arguments have to be specified:

  1. <attributeName> : Name of the actual attribute. Attribute names are case insensitive. The attribute name must be qualified with the entity name when the attribute name is not unique within the entity.
  2. <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.
  3. <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 , sdaiGetAttrs
Header:
#include "sdai.h"
Prototype:
void sdaiGetAttrsBN(SdaiInstance instance,
                     SdaiInteger  numberAttrs, 
                      ...); 
Arguments:

instance

A numeric instanceID that uniquely identifies an instance in the EDMdatabase.
The instanceID is defined by a sdaiCreateInstance or a sdaiCreateInstanceBN operation.

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:

  1. attributeName : Name of the actual attribute. Attribute names are case insensitive. The attribute name must be qualified with the entity name when the attribute name is not unique within the entity.
  2. 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.
  3. value : The address of 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>.

Returns:
void – use sdaiErrorQuery to check for error during operation.
Examples:
SdaiInstance instanceId;
SdaiString mystring;
SdaiReal myreal;
SdaiBoolean mybool;
SdaiInteger myint,anotherint;
SdaiErrorCode errCode;
...
sdaiGetAttrsBN(instanceId, 2,
"AttrString", sdaiSTRING, &mystring,  
"AttrReal", sdaiREAL, &myreal); 
if (errCode = sdaiErrorQuery()) {
/* Error in operation */ 
printf("\nError: %s in sdaiGetAttrsBN \n", 
edmiGetErrorText(errCode)); 
goto error; 
}
sdaiGetAttrsBN(instanceId, 3,
"Attr1", sdaiBOOLEAN, &mybool, 
"Attr2", sdaiINTEGER, &myint,
"Attr3", sdaiINTEGER, &anotherint);
...