ThingWorx C SDK
twShapes.h
Go to the documentation of this file.
1 #ifndef TW_C_SDK_TWSHAPES_H
2 #define TW_C_SDK_TWSHAPES_H
3 
4 /***************************************
5  * Copyright 2017, PTC, Inc.
6  ***************************************/
7 
16 #include <stdio.h>
17 #include <string.h>
18 #include <time.h>
19 #include "twApi.h"
20 #include "twOSPort.h"
21 #include "stringUtils.h"
22 #include <twBaseTypes.h>
23 #include "twStandardProps.h"
24 
25 
26 #ifndef true
27 #define true 1
28 #endif
29 
30 /* Types */
31 typedef void (*shapeHandlerFunction)(const char*,const char*);
32 typedef void (*templateHandlerFunction)(const char*,const char*);
33 
34 typedef twInfoTable* (*InitialConfigurationHandler)(void);
35 typedef void (*OnConfigureHandler)(twInfoTable*,char*);
36 
38  char *entityName;
39  char * templateName;
41 
42 typedef struct twThingNameToShapeRecord {
43  char *entityName;
44  char * shapeName;
46 
47 
48 /* Prototypes */
57 void * twExt_LoadExtensionLibrary(char *shapeLibraryName);
58 
66 char twExt_DoesThingImplementShape(char *entityName, char *shapeName);
67 
75 char twExt_DoesThingImplementTemplate(char *entityName, char *templateName);
76 
88 int twExt_AddEdgeThingShape(const char *entityName, const char *shapeName, const char *thing_namespace);
89 
96 void twExt_RegisterShape(const char *shapeName,
97  shapeHandlerFunction shapeConstructorFunction);
98 
104 void twExt_RegisterTemplate(const char *templateName, templateHandlerFunction handler);
105 
120 int twExt_CreateThingFromTemplate(const char *thingName, const char *templateName, ...);
121 
127 void twExt_SetThingAsBasedOnTemplateOf(const char *thingName, const char *templateName);
128 
139 void twExt_InheritFromTemplate(const char *thingName, const char *templateNameToInherit);
140 
148 service_cb twExt_GetCallbackForService(char *entityName, char *serviceName);
149 
172 int twExt_RegisterStandardProperty(const char *entityName, const char *propertyName, const char *thing_namespace,
173  enum BaseType propertyType, const char *propertyDescription,
174  char *propertyPushType,
175  double propertyPushThreshold);
176 
204 int twExt_RegisterNamespacedService(const char *entityName, const char *serviceName, const char *thing_namespace,
205  const char *serviceDescription,
206  twDataShape *inputs, enum BaseType outputType, twDataShape *outputDataShape,
207  service_cb cb, void *userdata);
208 
209 
210 #endif /*TW_C_SDK_TWSHAPES_H */
211 
void * twExt_LoadExtensionLibrary(char *shapeLibraryName)
Definition: twShapes.c:379
enum msgCodeEnum(* service_cb)(const char *entityName, const char *serviceName, twInfoTable *params, twInfoTable **content, void *userdata)
Signature of a callback function that is registered to be called when a specific service request is r...
Definition: twApi.h:114
void twExt_InheritFromTemplate(const char *thingName, const char *templateNameToInherit)
Definition: twShapes.c:632
service_cb twExt_GetCallbackForService(char *entityName, char *serviceName)
Definition: twShapes.c:645
String utility function prototypes.
void twExt_SetThingAsBasedOnTemplateOf(const char *thingName, const char *templateName)
Definition: twShapes.c:482
Wrappers for OS-specific functionality.
int twExt_CreateThingFromTemplate(const char *thingName, const char *templateName,...)
Definition: twShapes.c:593
char twExt_DoesThingImplementShape(char *entityName, char *shapeName)
Definition: twShapes.c:537
void twExt_RegisterShape(const char *shapeName, shapeHandlerFunction shapeConstructorFunction)
Definition: twShapes.c:568
Definition: twShapes.h:42
void twExt_RegisterTemplate(const char *templateName, templateHandlerFunction handler)
Definition: twShapes.c:588
int twExt_RegisterNamespacedService(const char *entityName, const char *serviceName, const char *thing_namespace, const char *serviceDescription, twDataShape *inputs, enum BaseType outputType, twDataShape *outputDataShape, service_cb cb, void *userdata)
Definition: twShapes.c:679
Portable ThingWorx C SDK API layer.
int twExt_AddEdgeThingShape(const char *entityName, const char *shapeName, const char *thing_namespace)
Definition: twShapes.c:574
Data shape base structure definition.
Definition: twInfoTable.h:184
char twExt_DoesThingImplementTemplate(char *entityName, char *templateName)
Definition: twShapes.c:505
ThingWorx BaseType definitions and functions.
Definition: twShapes.h:37
Info table base structure.
Definition: twInfoTable.h:418
int twExt_RegisterStandardProperty(const char *entityName, const char *propertyName, const char *thing_namespace, enum BaseType propertyType, const char *propertyDescription, char *propertyPushType, double propertyPushThreshold)
Definition: twShapes.c:652
BaseType
Definition: twDefinitions.h:156