ua_types.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. /*
  2. * Copyright (C) 2014 the contributors as stated in the AUTHORS file
  3. *
  4. * This file is part of open62541. open62541 is free software: you can
  5. * redistribute it and/or modify it under the terms of the GNU Lesser General
  6. * Public License, version 3 (as published by the Free Software Foundation) with
  7. * a static linking exception as stated in the LICENSE file provided with
  8. * open62541.
  9. *
  10. * open62541 is distributed in the hope that it will be useful, but WITHOUT ANY
  11. * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  13. * details.
  14. */
  15. #ifndef UA_TYPES_H_
  16. #define UA_TYPES_H_
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. #include <stdint.h>
  21. #include <stdbool.h>
  22. #include <stdio.h>
  23. #include "ua_config.h"
  24. /**
  25. * @defgroup types Datatypes
  26. *
  27. * @brief The built-in datatypes. The remaining datatypes are autogenerated from
  28. * XML descriptions as they are all enums or structures made up of the built-in
  29. * datatypes.
  30. *
  31. * All datatypes have similar functions with a common postfix. DO NOT CALL THESE
  32. * FUNCTIONS WITH NULL-POINTERS IF IT IS NOT EXPLICITLY PERMITTED.
  33. *
  34. * - _new: Allocates the memory for the type and runs _init on the returned
  35. * variable. Returns null if no memory could be allocated.
  36. *
  37. * - _init: Sets all members to a "safe" standard, usually zero. Arrays (e.g.
  38. * for strings) are set to a length of -1.
  39. *
  40. * - _copy: Copies a datatype. This performs a deep copy that iterates over the
  41. * members. Copying into variants with an external data source is not
  42. * permitted. If copying fails, a deleteMembers is performed and an error
  43. * code returned.
  44. *
  45. * - _delete: Frees the memory where the datatype was stored. This performs an
  46. * _deleteMembers internally if required.
  47. *
  48. * - _deleteMembers: Frees the memory of dynamically sized members (e.g. a
  49. * string) of a datatype. This is useful when the datatype was allocated on
  50. * the stack, whereas the dynamically sized members is heap-allocated. To
  51. * reuse the variable, the remaining members (not dynamically allocated) need
  52. * to be cleaned up with an _init.
  53. *
  54. * @{
  55. */
  56. /** @brief A two-state logical value (true or false). */
  57. typedef bool UA_Boolean;
  58. #define UA_TRUE true
  59. #define UA_FALSE false
  60. /** @brief An integer value between -129 and 127. */
  61. typedef int8_t UA_SByte;
  62. #define UA_SBYTE_MAX 127
  63. #define UA_SBYTE_MIN -128
  64. /** @brief An integer value between 0 and 256. */
  65. typedef uint8_t UA_Byte;
  66. #define UA_BYTE_MAX 256
  67. #define UA_BYTE_MIN 0
  68. /** @brief An integer value between -32 768 and 32 767. */
  69. typedef int16_t UA_Int16;
  70. #define UA_INT16_MAX 32767
  71. #define UA_INT16_MIN -32768
  72. /** @brief An integer value between 0 and 65 535. */
  73. typedef uint16_t UA_UInt16;
  74. #define UA_UINT16_MAX 65535
  75. #define UA_UINT16_MIN 0
  76. /** @brief An integer value between -2 147 483 648 and 2 147 483 647. */
  77. typedef int32_t UA_Int32;
  78. #define UA_INT32_MAX 2147483647
  79. #define UA_INT32_MIN −2147483648
  80. /** @brief An integer value between 0 and 429 4967 295. */
  81. typedef uint32_t UA_UInt32;
  82. #define UA_UINT32_MAX 4294967295
  83. #define UA_UINT32_MIN 0
  84. /** @brief An integer value between -10 223 372 036 854 775 808 and 9 223 372 036 854 775 807 */
  85. typedef int64_t UA_Int64;
  86. #define UA_INT64_MAX 9223372036854775807
  87. #define UA_INT64_MIN −9223372036854775808
  88. /** @brief An integer value between 0 and 18 446 744 073 709 551 615. */
  89. typedef uint64_t UA_UInt64;
  90. #define UA_UINT64_MAX = 18446744073709551615
  91. #define UA_UINT64_MIN = 0
  92. /** @brief An IEEE single precision (32 bit) floating point value. */
  93. typedef float UA_Float;
  94. /** @brief An IEEE double precision (64 bit) floating point value. */
  95. typedef double UA_Double;
  96. /** @brief A sequence of Unicode characters. */
  97. typedef struct {
  98. UA_Int32 length;
  99. UA_Byte *data;
  100. } UA_String;
  101. /** @brief An instance in time.
  102. *
  103. * A DateTime value is encoded as a 64-bit signed integer which represents the
  104. * number of 100 nanosecond intervals since January 1, 1601 (UTC).
  105. */
  106. typedef UA_Int64 UA_DateTime; // 100 nanosecond resolution
  107. /** @brief A 16 byte value that can be used as a globally unique identifier. */
  108. typedef struct {
  109. UA_UInt32 data1;
  110. UA_UInt16 data2;
  111. UA_UInt16 data3;
  112. UA_Byte data4[8];
  113. } UA_Guid;
  114. /** @brief A sequence of octets. */
  115. typedef UA_String UA_ByteString;
  116. /** @brief An XML element. */
  117. typedef UA_String UA_XmlElement;
  118. /** @brief An identifier for a node in the address space of an OPC UA Server. */
  119. /* The shortened numeric types are introduced during encoding. */
  120. typedef struct {
  121. UA_UInt16 namespaceIndex;
  122. enum {
  123. UA_NODEIDTYPE_NUMERIC = 2,
  124. UA_NODEIDTYPE_STRING = 3,
  125. UA_NODEIDTYPE_GUID = 4,
  126. UA_NODEIDTYPE_BYTESTRING = 5
  127. } identifierType;
  128. union {
  129. UA_UInt32 numeric;
  130. UA_String string;
  131. UA_Guid guid;
  132. UA_ByteString byteString;
  133. } identifier;
  134. } UA_NodeId;
  135. /** @brief A NodeId that allows the namespace URI to be specified instead of an index. */
  136. typedef struct {
  137. UA_NodeId nodeId;
  138. UA_String namespaceUri; // not encoded if length=-1
  139. UA_UInt32 serverIndex; // not encoded if 0
  140. } UA_ExpandedNodeId;
  141. #include "ua_statuscodes.h"
  142. /** @brief A numeric identifier for a error or condition that is associated with a value or an operation. */
  143. typedef enum UA_StatusCode UA_StatusCode; // StatusCodes aren't an enum(=int) since 32 unsigned bits are needed. See also ua_statuscodes.h */
  144. /** @brief A name qualified by a namespace. */
  145. typedef struct {
  146. UA_UInt16 namespaceIndex;
  147. UA_String name;
  148. } UA_QualifiedName;
  149. /** @brief Human readable text with an optional locale identifier. */
  150. typedef struct {
  151. UA_String locale;
  152. UA_String text;
  153. } UA_LocalizedText;
  154. /** @brief A structure that contains an application specific data type that may
  155. not be recognized by the receiver. */
  156. typedef struct {
  157. UA_NodeId typeId;
  158. enum {
  159. UA_EXTENSIONOBJECT_ENCODINGMASK_NOBODYISENCODED = 0,
  160. UA_EXTENSIONOBJECT_ENCODINGMASK_BODYISBYTESTRING = 1,
  161. UA_EXTENSIONOBJECT_ENCODINGMASK_BODYISXML = 2
  162. } encoding;
  163. UA_ByteString body; // contains either the bytestring or a pointer to the memory-object
  164. } UA_ExtensionObject;
  165. struct UA_TypeVTable; // forward declaration
  166. typedef struct UA_TypeVTable UA_TypeVTable;
  167. /** @brief Pointers to data that is stored in memory. The "type" of the data is
  168. stored in the variant itself. */
  169. typedef struct {
  170. UA_Int32 arrayLength; // total number of elements in the data-pointer
  171. void *dataPtr;
  172. UA_Int32 arrayDimensionsLength;
  173. UA_Int32 *arrayDimensions;
  174. } UA_VariantData;
  175. /** @brief A datasource is the interface to interact with a local data provider.
  176. *
  177. * Implementors of datasources need to provide functions for the callbacks in
  178. * this structure. As a rule, datasources are never copied, but only their
  179. * content. The only way to write into a datasource is via the write-service. */
  180. typedef struct {
  181. const void *identifier; /**< whatever id the datasource uses internally. Can be ignored if the datasource functions do not use it. */
  182. UA_Int32 (*read)(const void *identifier, const UA_VariantData **); /**< Get the current data from the datasource. When it is no longer used, the data has to be relased. */
  183. void (*release)(const void *identifier, const UA_VariantData *); /**< For concurrent access, the datasource needs to know when the last reader releases replaced/deleted data. Release decreases the reference count. */
  184. UA_Int32 (*write)(const void **identifier, const UA_VariantData *); /**< Replace the data in the datasource. Also used to replace the identifier pointer for lookups. Do not free the variantdata afterwards! */
  185. void (*delete)(const void *identifier); /**< Indicates that the node with the datasource was removed from the namespace. */
  186. } UA_VariantDataSource;
  187. /** @brief Variants store (arrays of) any data type. Either they provide a
  188. pointer to the data in memory, or functions from which the data can be
  189. accessed. */
  190. typedef struct {
  191. const UA_TypeVTable *vt; /// The VTable of the datatype in question
  192. enum {
  193. UA_VARIANT_DATA, ///< The data is stored in memory and "owned" by this variant
  194. UA_VARIANT_DATA_NODELETE, ///< The data is stored in memory, but only "borrowed" and shall not be deleted at the end of this variant's lifecycle
  195. UA_VARIANT_DATASOURCE ///< The data is provided externally. Call the functions in the datasource to get a current version
  196. } storageType;
  197. union {
  198. UA_VariantData data;
  199. UA_VariantDataSource datasource;
  200. } storage;
  201. } UA_Variant;
  202. /** @brief A data value with an associated status code and timestamps. */
  203. typedef struct {
  204. UA_Byte encodingMask;
  205. UA_Variant value;
  206. UA_StatusCode status;
  207. UA_DateTime sourceTimestamp;
  208. UA_Int16 sourcePicoseconds;
  209. UA_DateTime serverTimestamp;
  210. UA_Int16 serverPicoseconds;
  211. } UA_DataValue;
  212. enum UA_DATAVALUE_ENCODINGMASKTYPE_enum {
  213. UA_DATAVALUE_ENCODINGMASK_VARIANT = 0x01,
  214. UA_DATAVALUE_ENCODINGMASK_STATUSCODE = 0x02,
  215. UA_DATAVALUE_ENCODINGMASK_SOURCETIMESTAMP = 0x04,
  216. UA_DATAVALUE_ENCODINGMASK_SERVERTIMESTAMP = 0x08,
  217. UA_DATAVALUE_ENCODINGMASK_SOURCEPICOSECONDS = 0x10,
  218. UA_DATAVALUE_ENCODINGMASK_SERVERPICOSECONDS = 0x20
  219. };
  220. /** @brief A structure that contains detailed error and diagnostic information associated with a StatusCode. */
  221. typedef struct UA_DiagnosticInfo {
  222. UA_Byte encodingMask; // Type of the Enum UA_DIAGNOSTICINFO_ENCODINGMASKTYPE
  223. UA_Int32 symbolicId;
  224. UA_Int32 namespaceUri;
  225. UA_Int32 localizedText;
  226. UA_Int32 locale;
  227. UA_String additionalInfo;
  228. UA_StatusCode innerStatusCode;
  229. struct UA_DiagnosticInfo *innerDiagnosticInfo;
  230. } UA_DiagnosticInfo;
  231. enum UA_DIAGNOSTICINFO_ENCODINGMASKTYPE_enum {
  232. UA_DIAGNOSTICINFO_ENCODINGMASK_SYMBOLICID = 0x01,
  233. UA_DIAGNOSTICINFO_ENCODINGMASK_NAMESPACE = 0x02,
  234. UA_DIAGNOSTICINFO_ENCODINGMASK_LOCALIZEDTEXT = 0x04,
  235. UA_DIAGNOSTICINFO_ENCODINGMASK_LOCALE = 0x08,
  236. UA_DIAGNOSTICINFO_ENCODINGMASK_ADDITIONALINFO = 0x10,
  237. UA_DIAGNOSTICINFO_ENCODINGMASK_INNERSTATUSCODE = 0x20,
  238. UA_DIAGNOSTICINFO_ENCODINGMASK_INNERDIAGNOSTICINFO = 0x40
  239. };
  240. /** @brief Type use internally to denote an invalid datatype. */
  241. typedef void UA_InvalidType;
  242. /*************/
  243. /* Functions */
  244. /*************/
  245. #define UA_TYPE_PROTOTYPES(TYPE) \
  246. TYPE UA_EXPORT * TYPE##_new(void); \
  247. void UA_EXPORT TYPE##_init(TYPE * p); \
  248. void UA_EXPORT TYPE##_delete(TYPE * p); \
  249. void UA_EXPORT TYPE##_deleteMembers(TYPE * p); \
  250. UA_StatusCode UA_EXPORT TYPE##_copy(const TYPE *src, TYPE *dst); \
  251. void UA_EXPORT TYPE##_print(const TYPE *p, FILE *stream);
  252. #define UA_TYPE_PROTOTYPES_NOEXPORT(TYPE) \
  253. TYPE * TYPE##_new(void); \
  254. void TYPE##_init(TYPE * p); \
  255. void TYPE##_delete(TYPE * p); \
  256. void TYPE##_deleteMembers(TYPE * p); \
  257. UA_StatusCode TYPE##_copy(const TYPE *src, TYPE *dst); \
  258. void TYPE##_print(const TYPE *p, FILE *stream);
  259. /* Functions for all types */
  260. UA_TYPE_PROTOTYPES(UA_Boolean)
  261. UA_TYPE_PROTOTYPES(UA_SByte)
  262. UA_TYPE_PROTOTYPES(UA_Byte)
  263. UA_TYPE_PROTOTYPES(UA_Int16)
  264. UA_TYPE_PROTOTYPES(UA_UInt16)
  265. UA_TYPE_PROTOTYPES(UA_Int32)
  266. UA_TYPE_PROTOTYPES(UA_UInt32)
  267. UA_TYPE_PROTOTYPES(UA_Int64)
  268. UA_TYPE_PROTOTYPES(UA_UInt64)
  269. UA_TYPE_PROTOTYPES(UA_Float)
  270. UA_TYPE_PROTOTYPES(UA_Double)
  271. UA_TYPE_PROTOTYPES(UA_String)
  272. UA_TYPE_PROTOTYPES(UA_DateTime)
  273. UA_TYPE_PROTOTYPES(UA_Guid)
  274. UA_TYPE_PROTOTYPES(UA_ByteString)
  275. UA_TYPE_PROTOTYPES(UA_XmlElement)
  276. UA_TYPE_PROTOTYPES(UA_NodeId)
  277. UA_TYPE_PROTOTYPES(UA_ExpandedNodeId)
  278. UA_TYPE_PROTOTYPES(UA_StatusCode)
  279. UA_TYPE_PROTOTYPES(UA_QualifiedName)
  280. UA_TYPE_PROTOTYPES(UA_LocalizedText)
  281. UA_TYPE_PROTOTYPES(UA_ExtensionObject)
  282. UA_TYPE_PROTOTYPES(UA_DataValue)
  283. UA_TYPE_PROTOTYPES(UA_Variant)
  284. UA_TYPE_PROTOTYPES(UA_DiagnosticInfo)
  285. UA_TYPE_PROTOTYPES(UA_InvalidType)
  286. /**********************************************/
  287. /* Custom functions for the builtin datatypes */
  288. /**********************************************/
  289. /* String */
  290. #define UA_STRING_NULL (UA_String) {-1, (UA_Byte*)0 }
  291. #define UA_STRING_STATIC(VARIABLE, STRING) do { \
  292. VARIABLE.length = sizeof(STRING)-1; \
  293. VARIABLE.data = (UA_Byte *)STRING; } while(0)
  294. UA_StatusCode UA_EXPORT UA_String_copycstring(char const *src, UA_String *dst);
  295. UA_StatusCode UA_EXPORT UA_String_copyprintf(char const *fmt, UA_String *dst, ...);
  296. UA_Boolean UA_EXPORT UA_String_equal(const UA_String *string1, const UA_String *string2);
  297. void UA_EXPORT UA_String_printf(char const *label, const UA_String *string);
  298. void UA_EXPORT UA_String_printx(char const *label, const UA_String *string);
  299. void UA_EXPORT UA_String_printx_hex(char const *label, const UA_String *string);
  300. /* DateTime */
  301. UA_DateTime UA_EXPORT UA_DateTime_now(void);
  302. typedef struct UA_DateTimeStruct {
  303. UA_Int16 nanoSec;
  304. UA_Int16 microSec;
  305. UA_Int16 milliSec;
  306. UA_Int16 sec;
  307. UA_Int16 min;
  308. UA_Int16 hour;
  309. UA_Int16 day;
  310. UA_Int16 month;
  311. UA_Int16 year;
  312. } UA_DateTimeStruct;
  313. UA_DateTimeStruct UA_EXPORT UA_DateTime_toStruct(UA_DateTime time);
  314. UA_StatusCode UA_EXPORT UA_DateTime_toString(UA_DateTime time, UA_String *timeString);
  315. /* Guid */
  316. UA_Boolean UA_EXPORT UA_Guid_equal(const UA_Guid *g1, const UA_Guid *g2);
  317. /** Do not use for security-critical entropy! */
  318. UA_Guid UA_EXPORT UA_Guid_random(UA_UInt32 *seed);
  319. /* ByteString */
  320. UA_Boolean UA_EXPORT UA_ByteString_equal(const UA_ByteString *string1, const UA_ByteString *string2);
  321. UA_StatusCode UA_EXPORT UA_ByteString_newMembers(UA_ByteString *p, UA_Int32 length);
  322. void UA_EXPORT UA_ByteString_printf(char *label, const UA_ByteString *string);
  323. void UA_EXPORT UA_ByteString_printx(char *label, const UA_ByteString *string);
  324. void UA_EXPORT UA_ByteString_printx_hex(char *label, const UA_ByteString *string);
  325. /* NodeId */
  326. UA_Boolean UA_EXPORT UA_NodeId_equal(const UA_NodeId *n1, const UA_NodeId *n2);
  327. UA_Boolean UA_EXPORT UA_NodeId_isNull(const UA_NodeId *p);
  328. /* ExpandedNodeId */
  329. UA_Boolean UA_EXPORT UA_ExpandedNodeId_isNull(const UA_ExpandedNodeId *p);
  330. /* QualifiedName */
  331. #define UA_QUALIFIEDNAME_STATIC(VARIABLE, STRING) do { \
  332. VARIABLE.namespaceIndex = 0; \
  333. UA_STRING_STATIC(VARIABLE.name, STRING); } while(0)
  334. UA_StatusCode UA_EXPORT UA_QualifiedName_copycstring(char const *src, UA_QualifiedName *dst);
  335. void UA_EXPORT UA_QualifiedName_printf(char const *label, const UA_QualifiedName *qn);
  336. /* LocalizedText */
  337. #define UA_LOCALIZEDTEXT_STATIC(VARIABLE, STRING) do { \
  338. UA_STRING_STATIC(VARIABLE.locale, "en"); \
  339. UA_STRING_STATIC(VARIABLE.text, STRING); } while(0)
  340. UA_StatusCode UA_EXPORT UA_LocalizedText_copycstring(char const *src, UA_LocalizedText *dst);
  341. /* Variant */
  342. UA_StatusCode UA_EXPORT UA_Variant_copySetValue(UA_Variant *v, const UA_TypeVTable *vt, const void *value);
  343. UA_StatusCode UA_EXPORT UA_Variant_copySetArray(UA_Variant *v, const UA_TypeVTable *vt, UA_Int32 arrayLength, const void *array);
  344. /* Array operations */
  345. UA_StatusCode UA_EXPORT UA_Array_new(void **p, UA_Int32 noElements, const UA_TypeVTable *vt);
  346. void UA_EXPORT UA_Array_init(void *p, UA_Int32 noElements, const UA_TypeVTable *vt);
  347. void UA_EXPORT UA_Array_delete(void *p, UA_Int32 noElements, const UA_TypeVTable *vt);
  348. /* @brief The destination array is allocated with size noElements. */
  349. UA_StatusCode UA_EXPORT UA_Array_copy(const void *src, UA_Int32 noElements, const UA_TypeVTable *vt, void **dst);
  350. void UA_EXPORT UA_Array_print(const void *p, UA_Int32 noElements, const UA_TypeVTable *vt, FILE *stream);
  351. /*******************/
  352. /* TypeDescription */
  353. /*******************/
  354. #define UA_MAX_MEMBERS 16 // Maximum number of members per complex type
  355. /**
  356. * The type descriptions points to the table in which the type is defined.
  357. * That is necessary so that we can find the layouts of the member types.
  358. *
  359. * DataTypeTables are self-contained. Only the built-in types can be assumed.
  360. * All the other types must be built up within the same table and cannot
  361. * cross-reference. In the server, we store one datatypetable per namespace.
  362. */
  363. typedef struct {
  364. UA_UInt16 memSize; ///< Size of the struct in memory
  365. UA_UInt16 binarySize : 14; ///< Size of the type in binary encoding. Including _all_ members with constantSize == true.
  366. UA_Boolean constantSize : 1; ///< Does the type have constant size in memory? (no pointers, also not in members)
  367. UA_Boolean binaryZeroCopy: 1; ///< Given an array of this type, can we just point into the binary stream? The boolean is a shortcut for (memSize == binarySize && constantSize).
  368. UA_Boolean isBuiltin : 1; ///< The type is builtin. Use special functions if necessary. membersSize is 0, but the builtin-type index we have is encoded in memberDetails[0].memberTypeIndex.
  369. struct {
  370. UA_UInt16 memberTypeIndex : 10; ///< Index of the member in the datatypelayout table
  371. UA_Byte padding : 5; ///< How much padding is there before this member element?
  372. UA_Boolean isArray : 1;
  373. } memberDetails[UA_MAX_MEMBERS];
  374. UA_Byte membersSize; ///< How many members does the struct have? (max. 32)
  375. struct UA_DataTypeLayout *table; /**< Point to the beginning of the table where the members can be found with their indices */
  376. } UA_DataTypeLayout;
  377. typedef struct {
  378. UA_UInt16 tableSize;
  379. UA_DataTypeLayout *layouts;
  380. UA_NodeId *typeIds;
  381. UA_String typeNames;
  382. } UA_TypeDescriptionTable;
  383. /**********/
  384. /* VTable */
  385. /**********/
  386. typedef struct UA_Encoding {
  387. /** Returns the size of the encoded element.*/
  388. UA_UInt32 (*calcSize)(const void *p);
  389. /** Encodes the type into the destination bytestring. */
  390. UA_StatusCode (*encode)(const void *src, UA_ByteString *dst, UA_UInt32 *offset);
  391. /** Decodes a ByteString into an UA datatype. */
  392. UA_StatusCode (*decode)(const UA_ByteString *src, UA_UInt32 *offset, void *dst);
  393. } UA_Encoding;
  394. #define UA_ENCODING_BINARY 0 // Binary encoding is always available
  395. struct UA_TypeVTable {
  396. UA_NodeId typeId;
  397. UA_Byte *name;
  398. void * (*new)(void);
  399. void (*init)(void *p);
  400. UA_StatusCode (*copy)(void const *src, void *dst);
  401. void (*delete)(void *p);
  402. void (*deleteMembers)(void *p);
  403. #ifdef UA_DEBUG
  404. void (*print)(const void *p, FILE *stream);
  405. #endif
  406. UA_UInt32 memSize; // size of the struct
  407. UA_Boolean dynMembers; // does the type contain members that are dynamically on the heap?
  408. UA_Encoding encodings[UA_ENCODING_AMOUNT]; // binary, xml, ... UA_ENCODING_AMOUNT is set by the build script
  409. };
  410. /** @} */
  411. #ifdef __cplusplus
  412. } // extern "C"
  413. #endif
  414. #endif /* UA_TYPES_H_ */