15 #ifndef TW_INFOTABLE_H
16 #define TW_INFOTABLE_H
int twInfoTable_GetNumber(twInfoTable *it, const char *name, int32_t row, double *value)
Helper function to retrieve a TW_NUMBER from a twInfoTable.
Definition: twInfoTable.c:802
twInfoTable * twInfoTable_CreateFromString(const char *name, char *value, char duplicate)
Helper function to create a twInfoTable with a single field and single row containing a TW_STRING...
Definition: twInfoTable.c:734
int twDataShape_ToStream(struct twDataShape *ds, twStream *s)
Serializes a twDataShape to a twStream.
Definition: twInfoTable.c:362
twInfoTable * twInfoTable_CreateFromJson(struct cJSON *json, char *singleEntryName)
Helper function that creates a twInfoTable from a cJSON object. If the JSON object does not represent...
Definition: twInfoTable.c:951
char * name
Definition: twInfoTable.h:32
void twDataShapeAspect_Delete(void *aspect)
Frees all memory associated with a twDataShapeAspect and all its owned substructures.
Definition: twInfoTable.c:52
twInfoTable * twInfoTable_CreateFromInteger(const char *name, int32_t value)
Helper function to create a twInfoTable with a single field and single row containing a TW_INTEGER...
Definition: twInfoTable.c:742
int twInfoTable_GetInteger(twInfoTable *it, const char *name, int32_t row, int32_t *value)
Helper function to retrieve a TW_INTEGER from a twInfoTable.
Definition: twInfoTable.c:809
twDataShape * ds
Definition: twInfoTable.h:419
twPrimitive * twInfoTableRow_GetEntry(twInfoTableRow *row, int index)
Gets the twPrimitive value of an entry in a twInfoTableRow.
Definition: twInfoTable.c:497
int twInfoTable_GetLocation(twInfoTable *it, const char *name, int32_t row, twLocation *value)
Helper function to retrieve a TW_LOCATION from a twInfoTable.
Definition: twInfoTable.c:816
struct twInfoTableRow twInfoTableRow
Info table row structure.
twDataShape * twDataShape_Create(twDataShapeEntry *firstEntry)
Creates a new twDataShape structure.
Definition: twInfoTable.c:235
void twDataShapeEntry_Delete(void *entry)
Frees all memory associated with a twDataShapeEntry structure and all its owned substructures.
Definition: twInfoTable.c:146
int twInfoTableRow_ToStream(twInfoTableRow *row, twStream *s)
Serializes a twInfoTableRow to a twStream.
Definition: twInfoTable.c:508
int twInfoTable_AddRow(twInfoTable *it, twInfoTableRow *row)
Adds a twInfoTableRow to a twInfoTable.
Definition: twInfoTable.c:670
uint32_t twDataShape_GetLength(struct twDataShape *ds)
Retrieves the length of a twDataShape.
Definition: twInfoTable.c:317
twList * entries
Definition: twInfoTable.h:186
twDataShape * twDataShape_CreateFromStream(struct twStream *s)
Creates a new twDataShape structure from data in a twStream.
Definition: twInfoTable.c:258
struct cJSON * twDataShape_ToJson(twDataShape *ds, struct cJSON *parent)
Helper function that outputs a twDataShape to a cJSON object.
Definition: twInfoTable.c:884
void twInfoTableRow_Delete(void *row)
Deletes a twInfoTableRow structure and frees all memory associated with it.
Definition: twInfoTable.c:452
int twDataShape_GetEntryIndex(struct twDataShape *ds, const char *name, int *index)
Gets the index of the twDataShapeEntry with the specified name.
Definition: twInfoTable.c:335
char * name
Definition: twInfoTable.h:187
int twDataShape_SetName(struct twDataShape *ds, char *name)
Sets the name of a twDataShape.
Definition: twInfoTable.c:296
twInfoTableRow * twInfoTableRow_Create(twPrimitive *firstEntry)
Creates a new twInfoTableRow.
Definition: twInfoTable.c:381
int twInfoTableRow_GetCount(twInfoTableRow *row)
Gets the number of fields in a twInfoTableRow.
Definition: twInfoTable.c:462
twInfoTable * twInfoTable_CreateFromDatetime(const char *name, DATETIME value)
Helper function to create a twInfoTable with a single field and single row containing a TW_DATETIME...
Definition: twInfoTable.c:754
#define TW_MUTEX
For Linux builds a TW_MUTEX is a pthread_mutex_t.
Definition: twLinux-openssl.h:81
twList * rows
Definition: twInfoTable.h:420
twPrimitive * value
Definition: twInfoTable.h:33
TW_MUTEX mtx
Definition: twInfoTable.h:422
int twInfoTable_ToStream(twInfoTable *it, twStream *s)
Serializes a twInfoTable to a twStream.
Definition: twInfoTable.c:695
struct twDataShapeAspect twDataShapeAspect
Data shape aspect structure definition.
struct twDataShape twDataShape
Data shape base structure definition.
Dynamically allocated byte array. Automatically expands its length as needed.
Definition: twBaseTypes.h:35
int numEntries
Definition: twInfoTable.h:185
uint16_t numFields
Definition: twInfoTable.h:303
twDataShapeEntry * twDataShapeEntry_CreateFromStream(struct twStream *s)
Creates a new twDataShapeEntry structure from data in a twStream.
Definition: twInfoTable.c:87
Wrappers for OS-specific functionality.
Linked list structure definition.
Definition: twList.h:46
int twInfoTable_Compare(twInfoTable *p1, twInfoTable *p2)
Compares two twInfoTable structures for equivalence.
Definition: twInfoTable.c:642
int twDataShapeEntry_ToStream(struct twDataShapeEntry *entry, twStream *s)
Serializes a twDataShapeEntry to a twStream.
Definition: twInfoTable.c:194
twDataShapeAspect * twDataShapeAspect_Create(const char *name, twPrimitive *value)
Creates a new twDataShapeAspect structure.
Definition: twInfoTable.c:16
void twDataShape_Delete(void *ds)
Frees all memory associated with a twDataShape structure and all its owned substructures.
Definition: twInfoTable.c:284
uint32_t twDataShapeEntry_GetLength(struct twDataShapeEntry *entry)
Retrieves the length of a twDataShapeEntry.
Definition: twInfoTable.c:164
int twInfoTable_GetBoolean(twInfoTable *it, const char *name, int32_t row, char *value)
Helper function to retrieve a TW_BOOLEAN from a twInfoTable.
Definition: twInfoTable.c:839
twInfoTable * twInfoTable_CreateFromNumber(const char *name, double value)
Helper function to create a twInfoTable with a single field and single row containing a TW_NUMBER...
Definition: twInfoTable.c:738
twDataShapeAspect * twDataShapeAspect_CreateFromStream(twStream *s)
Creates a new twDataShapeAspect structure from data in a twStream.
Definition: twInfoTable.c:32
void twInfoTable_Delete(void *it)
Frees all memory associated with a twInfoTable structure and all its owned substructures.
Definition: twInfoTable.c:627
twList * fieldEntries
Definition: twInfoTable.h:304
int twInfoTableRow_AddEntry(twInfoTableRow *row, twPrimitive *entry)
Adds a new twPrimitive to a twInfoTableRow.
Definition: twInfoTable.c:487
twInfoTable * twInfoTable_CreateFromLocation(const char *name, twLocation *value)
Helper function to create a twInfoTable with a single field and single row containing a TW_LOCATION...
Definition: twInfoTable.c:746
twInfoTable * twInfoTable_FullCopy(twInfoTable *it)
Creates a new twInfoTable structure and copies all data from an existing twInfoTable structure to the...
Definition: twInfoTable.c:597
DataShape entry structure definition.
Definition: twInfoTable.h:84
twDataShapeEntry * twDataShapeEntry_Create(const char *name, const char *description, enum BaseType type)
Creates a new twDataShapeEntry structure.
Definition: twInfoTable.c:64
Data shape base structure definition.
Definition: twInfoTable.h:184
twInfoTable * twInfoTable_CreateFromPrimitive(const char *name, twPrimitive *value)
Helper function to create a twInfoTable with a single field and single row containing a type and valu...
Definition: twInfoTable.c:717
ThingWorx BaseType definitions and functions.
struct twDataShapeEntry twDataShapeEntry
DataShape entry structure definition.
uint32_t length
Definition: twInfoTable.h:421
twList * aspects
Definition: twInfoTable.h:88
struct cJSON * twInfoTable_ToJson(twInfoTable *it)
Helper function that outputs a twInfoTable to a cJSON object.
Definition: twInfoTable.c:1109
twInfoTable * twInfoTable_CreateFromBoolean(const char *name, char value)
Helper function to create a twInfoTable with a single field and single row containing a TW_BOOLEAN...
Definition: twInfoTable.c:758
Info table base structure.
Definition: twInfoTable.h:418
twInfoTable * twInfoTable_CreateFromBlob(const char *name, char *value, int32_t length, char isImage, char duplicate)
Helper function to create a twInfoTable with a single field and single row containing a TW_BLOB or TW...
Definition: twInfoTable.c:750
Info table row structure.
Definition: twInfoTable.h:302
int twDataShapeEntry_AddAspect(struct twDataShapeEntry *entry, const char *name, twPrimitive *value)
Creates a new twDataShapeAspect with twDataShapeAspect::value value and adds it to the specified twDa...
Definition: twInfoTable.c:159
char * name
Definition: twInfoTable.h:85
int twInfoTable_GetDatetime(twInfoTable *it, const char *name, int32_t row, DATETIME *value)
Helper function to retrieve a TW_DATETIME from a twInfoTable.
Definition: twInfoTable.c:833
int twInfoTable_GetString(twInfoTable *it, const char *name, int32_t row, char **value)
Helper function to retrieve a TW_STRING from a twInfoTable.
Definition: twInfoTable.c:795
struct twInfoTable twInfoTable
Info table base structure.
twInfoTable * twInfoTable_ZeroCopy(twInfoTable *it)
Creates a new twInfoTable structure which inherits all pointers of an existing twInfoTable structure ...
Definition: twInfoTable.c:610
twInfoTable * twInfoTable_CreateFromStream(twStream *s)
Creates a new twInfoTable from data in a twStream.
Definition: twInfoTable.c:555
Location primitive structure.
Definition: twBaseTypes.h:181
int twInfoTable_GetPrimitive(twInfoTable *it, const char *name, int32_t row, twPrimitive **value)
Helper function to retrieve a twPrimitive from a twInfoTable.
Definition: twInfoTable.c:788
uint32_t twInfoTableRow_GetLength(twInfoTableRow *row)
Gets the length of a twInfoTableRow.
Definition: twInfoTable.c:470
twInfoTableRow * twInfoTableRow_CreateFromStream(twStream *s)
Creates a new twInfoTableRow from data in a twStream.
Definition: twInfoTable.c:403
int twDataShape_AddEntry(struct twDataShape *ds, struct twDataShapeEntry *entry)
Adds a new twDataShapeEntry to a twDataShape.
Definition: twInfoTable.c:305
BaseType
Definition: twDefinitions.h:155
twInfoTableRow * twInfoTable_GetEntry(twInfoTable *it, int index)
Retrieves the twInfoTableRow from a twInfoTable at the specified (zero based) index.
Definition: twInfoTable.c:684
BaseType primitive structure.
Definition: twBaseTypes.h:207
Data shape aspect structure definition.
Definition: twInfoTable.h:31
enum BaseType type
Definition: twInfoTable.h:87
int twInfoTable_GetBlob(twInfoTable *it, const char *name, int32_t row, char **value, int32_t *length)
Helper function to retrieve a TW_BLOB from a twInfoTable.
Definition: twInfoTable.c:825
twInfoTable * twInfoTable_Create(twDataShape *shape)
Creates a new twInfoTable.
Definition: twInfoTable.c:532
char * description
Definition: twInfoTable.h:86