ThingWorx Edge C SDK > Interacting with ThingWorx > Basic Data Structures > ThingWorx Base Types
  
ThingWorx Base Types
The supported base types consist of the following:
Base Types
Base Type
Description
TW_NOTHING
An empty val.
TW_STRING
A modified UTF8 encoded string. Data and length are stored in val.bytes and val.len, respectively. The twPrimitive owns the data pointer and will free it when deleted. TW_STRING types are null terminated.
TW_NUMBER
A C double value, stored in val.double.
TW_BOOLEAN
Represented as a single char, stored in val.boolean.
TW_DATETIME
A DATETIME value, which is an unsigned 64 bit value representing milliseconds since the epoch 1/1/1970. Data is stored in val.datetime.
TW_INFOTABLE
A pointer to a complex structure (defined in the next section) and stored in val.infotable. The twPrimitive owns this pointer and will free up the memory pointed to when the twPrimitive is deleted.
TW_LOCATION
A structure consisting of three double floating point values – longitude, latitude, and elevation. Stored as val.location.
TW_BLOB
A pointer to a character array. Data and length are stored in val.bytes and val.len, respectively. Differs from TW_STRING in that the array may contain nulls. The twPrimitive owns the data pointer and will free it when deleted.
TW_IMAGE
Identical to TW_BLOB except for the type difference.
TW_INTEGER
Assigned 4 by integral value. Stored as val.integer.
TW_VARIANT
Pointer to a structure that contain a type enum and a twPrimitive value. The pointer is stored as val.variant. The twPrimitive owns the pointer and will free the structure when deleted.
TW_XML,TW_JSON, TW_QUERY, TW_HYPERLINK, TW_IMAGELINK, TW_PASSWORD, TW_HTML, TW_TEXT, TW_TAGS, TW_GUID,TW_THINGNAME, TW_THINGSHAPENAME, TW_THINGTEMPLATENAME, TW_DATASHAPENAME, TW_MASHUPNAME, TW_MENUNAME, TW_BASETYPENAME, TW_USERNAME, TW_GROUPNAME, TW_CATEGORYNAME, TW_STATEDEFINITIONNAME, TW_STYLEDEFINITIONNAME, TW_MODELTAGVOCABULARYNAME, TW_DATATAGVOCABULARYNAME, TW_NETWORKNAME, TW_MEDIAENTITYNAME, TW_APPLICATIONKEYNAME, TW_LOCALIZATIONTABLENAME, TW_ORGANIZATIONNAME
These base types are all of the TW_STRING family and are stored similarly.