ThingWorx C SDK
Macros
Primitive Declaration Macros

Macros

#define TW_MAKE_NUMBER(numberValue)   twPrimitive_CreateFromNumber((double)numberValue)
 This macro creates Number primitives from C doubles. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 
#define TW_MAKE_INT(intValue)   twPrimitive_CreateFromInteger(intValue)
 This macro creates Integer primitives from C unsigned integers. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 
#define TW_MAKE_STRING(stringValue)   twPrimitive_CreateFromString((char*)stringValue,TRUE)
 This macro creates String primitives from a C char *. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 
#define TW_MAKE_BOOL(boolValue)   twPrimitive_CreateFromBoolean(boolValue)
 This macro creates Boolean primitives from a C char which is the SDK boolean type. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 
#define TW_MAKE_DATETIME(timestamp)   twPrimitive_CreateFromDatetime(timestamp)
 This macro creates DateTime primitives from a C DATETIME. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 
#define TW_MAKE_DATETIME_NOW   twPrimitive_CreateFromDatetime(twGetSystemTime(TRUE))
 A convenience version of TW_MAKE_DATETIME that assumes you want to create a primitive representing the current time. It requires no arguments. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 
#define TW_MAKE_EMPTY   twPrimitive_Create()
 This macro creates an emptry Primitive of type TW_NOTHING. It requires not arguments. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 
#define TW_MAKE_LOC(latitude, longitude, elevation)   twPrimitive_CreateFromLocationAndDelete(twCreateLocationFrom(latitude,longitude,elevation))
 This macro creates a Location primitive from a latitude, longitude and elevation. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE(). More...
 

Detailed Description

Macro Definition Documentation

#define TW_MAKE_BOOL (   boolValue)    twPrimitive_CreateFromBoolean(boolValue)

This macro creates Boolean primitives from a C char which is the SDK boolean type. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Parameters
boolValuechar A C char to be converted
Returns
twPrimitive* the created primitive value.
#define TW_MAKE_DATETIME (   timestamp)    twPrimitive_CreateFromDatetime(timestamp)

This macro creates DateTime primitives from a C DATETIME. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Parameters
timestampC DATETIME to be converted
Returns
twPrimitive* the created primitive value.
#define TW_MAKE_DATETIME_NOW   twPrimitive_CreateFromDatetime(twGetSystemTime(TRUE))

A convenience version of TW_MAKE_DATETIME that assumes you want to create a primitive representing the current time. It requires no arguments. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Returns
twPrimitive* the created primitive value.
#define TW_MAKE_EMPTY   twPrimitive_Create()

This macro creates an emptry Primitive of type TW_NOTHING. It requires not arguments. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Returns
twPrimitive* the created primitive value.
#define TW_MAKE_INT (   intValue)    twPrimitive_CreateFromInteger(intValue)

This macro creates Integer primitives from C unsigned integers. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Parameters
numberValueint32_t[in] A C signed integer value to be converted
Returns
twPrimitive* the created primitive value.
#define TW_MAKE_LOC (   latitude,
  longitude,
  elevation 
)    twPrimitive_CreateFromLocationAndDelete(twCreateLocationFrom(latitude,longitude,elevation))

This macro creates a Location primitive from a latitude, longitude and elevation. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Parameters
latitudedouble [in]
longitudedouble [in]
elevationdouble [in]
Returns
twPrimitive* the created primitive value.
#define TW_MAKE_NUMBER (   numberValue)    twPrimitive_CreateFromNumber((double)numberValue)

This macro creates Number primitives from C doubles. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Parameters
numberValuedouble[in] A c double value to be converted
Returns
twPrimitive* the created primitive value.
#define TW_MAKE_STRING (   stringValue)    twPrimitive_CreateFromString((char*)stringValue,TRUE)

This macro creates String primitives from a C char *. Useful for populating InfoTables or calling API functions. Note that the returned primitive has been allocated on the heap and if not used in a function call that takes over responsibility for this value, must be disposed of with TW_FREE().

Parameters
stringValueconst char*[in] A C string value to be converted
Returns
twPrimitive* the created primitive value.