SDK Attributes

From ActiveWiki
Jump to: navigation, search


The Active Worlds SDK uses attributes for communicating data back and forth between the application and the SDK. Attributes are similar to variables in that they store values that can be queried and changed. Many SDK attributes, are read only, meaning that they cannot be changed by the application and exist only for communicating information to the application from the SDK.

Attributes are stored per-instance. This means that in a multi-instance application setting an attribute sets it for the current instance only.

Typically, in order to pass data into the SDK, an SDK application sets one or more attributes before calling an SDK method. Once the method completes, the application then queries one or more attributes to retrieve the results of the operation or event.

Attributes can be one of five data types:

A 32-bit integer value. Use aw_int to query the value of integer attributes and aw_int_set to set them.
A multi-character string from 0 to 255 (in same cases up to 1000) bytes long. Use aw_string to query the value of string attributes and aw_string_set to set them.
A boolean flag indicating either true (1) or false (0). Use aw_bool to query the value of boolean attributes and aw_bool_set to set them.
A 32-bit floating point (i.e. non-integer) numeric value. Use aw_float to query the value of floating point attributes and aw_float_set to set them.
A char* pointer to a data buffer (binary data). Use aw_data to query binary data attributes and aw_data_set to set them.

See also