ThingWorx C SDK
twProperties.h
Go to the documentation of this file.
1 /***************************************
2  * Copyright (C) 2014 ThingWorx Inc. *
3  ***************************************/
4 
11 #ifndef PROPERTIES_H
12 #define PROPERTIES_H
13 
14 #include "twOSPort.h"
15 #include "twLogger.h"
16 #include "twBaseTypes.h"
17 #include "twInfoTable.h"
18 #include "cJSON.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
27 typedef struct twPropertyDef {
28  char * name;
29  char * description;
30  enum BaseType type;
31  cJSON * aspects;
33 
52 twPropertyDef * twPropertyDef_Create(char * name, enum BaseType type, char * description, char * pushType, double pushThreshold);
53 
63 void twPropertyDef_Delete(void * input);
64 
68 typedef struct twProperty {
69  char * name;
71  DATETIME timestamp;
72  char * quality;
73 } twProperty;
74 
93 twProperty * twProperty_Create(char * name, twPrimitive * value, DATETIME timestamp);
94 
115 twProperty * twPropertyVTQ_Create(char * name, twPrimitive * value, DATETIME timestamp, char * quality);
116 
117 
126 
136 void twProperty_Delete(void * input);
137 
138 #ifdef __cplusplus
139 }
140 #endif
141 
142 #endif /* PROPERTIES_H */
struct twProperty twProperty
Property base structure.
enum BaseType type
Definition: twProperties.h:30
twProperty * twProperty_Create(char *name, twPrimitive *value, DATETIME timestamp)
Creates a new twProperty structure.
Definition: twProperties.c:50
void twProperty_Delete(void *input)
Frees all memory associated with a twProperty structure and all its owned substructures.
Definition: twProperties.c:98
ThingWorx twInfoTable and twDataShape definitions and functions.
twProperty * twPropertyVTQ_Create(char *name, twPrimitive *value, DATETIME timestamp, char *quality)
Creates a new twProperty structure with an OPC style Quality value.
Definition: twProperties.c:54
void twPropertyDef_Delete(void *input)
Frees all memory associated with a twPropertyDef structure and all its owned substructures.
Definition: twProperties.c:40
Dynamically allocated byte array. Automatically expands its length as needed.
Definition: twBaseTypes.h:35
Wrappers for OS-specific functionality.
twProperty * twProperty_CreateFromStream(twStream *s)
Creates a new twProperty structure from a :twStream.
Definition: twProperties.c:74
DATETIME timestamp
Definition: twProperties.h:71
char * quality
Definition: twProperties.h:72
char * description
Definition: twProperties.h:29
char * name
Definition: twProperties.h:28
struct twPropertyDef twPropertyDef
Property definition structure.
ThingWorx BaseType definitions and functions.
Property base structure.
Definition: twProperties.h:68
twPropertyDef * twPropertyDef_Create(char *name, enum BaseType type, char *description, char *pushType, double pushThreshold)
Creates a new twPropertyDef structure.
Definition: twProperties.c:15
Property definition structure.
Definition: twProperties.h:27
Structure definitions and function prototypes for the ThingWorx logging facility. ...
Definition: cJSON.h:43
twPrimitive * value
Definition: twProperties.h:70
BaseType
Definition: twDefinitions.h:155
BaseType primitive structure.
Definition: twBaseTypes.h:207