ThingWorx C SDK
twThreadUtils.h
Go to the documentation of this file.
1 /***************************************
2  * Copyright 2017, PTC, Inc.
3  ***************************************/
4 #ifndef TW_C_SDK_TWTHREADUTILS_H
5 #define TW_C_SDK_TWTHREADUTILS_H
6 
29 #include "twOSPort.h"
30 #include "twMap.h"
31 
32 enum twThreadingModel {TW_THREADING_SINGLE=0,TW_THREADING_TASKER=1,TW_THREADING_MULTI=2};
33 
34 typedef void (*twOnPolled)(char* entityName);
35 typedef struct twPolledFunctionRecord {
36  twOnPolled onPolledFunction;
37  char * shapeName;
38  char * templateName;
40 
49 void twExt_RegisterPolledTemplateFunction(twOnPolled polledFunction, char *templateName);
50 
59 void twExt_RegisterPolledShapeFunction(twOnPolled polledFunction, char *shapeName);
60 
66 void twExt_RemovePolledFunction(twOnPolled polledFunction);
67 
75 void twExt_PerformPolledFunctions(DATETIME now, void *params);
76 
87 void twExt_Idle(uint32_t intervalMsec, enum twThreadingModel threadingModel, uint32_t messageHandlerThreadCount);
88 
98 void twExt_Start(uint32_t dataCollectionRate, enum twThreadingModel threadingModel,
99  uint32_t messageHandlerThreadCount);
100 
106 int twExt_Stop();
107 
114 int twExt_WaitUntilFirstSynchronization(uint32_t timeoutMills);
115 
116 #endif //TW_C_SDK_TWTHREADUTILS_H
Definition: twThreadUtils.h:35
void twExt_PerformPolledFunctions(DATETIME now, void *params)
Definition: twThreadUtils.c:122
Wrappers for OS-specific functionality.
void twExt_RemovePolledFunction(twOnPolled polledFunction)
Definition: twThreadUtils.c:106
void twExt_RegisterPolledShapeFunction(twOnPolled polledFunction, char *shapeName)
Definition: twThreadUtils.c:83
int twExt_WaitUntilFirstSynchronization(uint32_t timeoutMills)
Definition: twThreadUtils.c:314
int twExt_Stop()
Definition: twThreadUtils.c:266
void twExt_RegisterPolledTemplateFunction(twOnPolled polledFunction, char *templateName)
Definition: twThreadUtils.c:60
void twExt_Idle(uint32_t intervalMsec, enum twThreadingModel threadingModel, uint32_t messageHandlerThreadCount)
Definition: twThreadUtils.c:235
void twExt_Start(uint32_t dataCollectionRate, enum twThreadingModel threadingModel, uint32_t messageHandlerThreadCount)
Definition: twThreadUtils.c:164