TEMU  3.0
The Terma Emulator
Objsys.h
Go to the documentation of this file.
1 //===-- temu-c/Objsys.h - TEMU Object System -------------------*- C++ -*-===//
2 //
3 // TEMU: The Terma Emulator
4 // (c) Terma 2015, 2016, 2021
5 // Authors: Mattias Holm <maho (at) terma.com>
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef TEMU_OBJSYS_C_H
10 #define TEMU_OBJSYS_C_H
11 
14 #include <assert.h>
15 #include <stddef.h>
16 #include <stdint.h>
17 #include <stdlib.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #ifdef __cplusplus
24 #define TEMU_PLUGIN_INIT extern "C" TEMU_API void temu_pluginInit(void)
25 #else
26 #define TEMU_PLUGIN_INIT TEMU_API void temu_pluginInit(void)
27 #endif
28 
29 #if defined(__has_attribute)
30 #if __has_attribute(annotate)
31 #define TEMU_NO_WRAP __attribute__((annotate("temu-no-wrap")))
32 #endif
33 #endif
34 
35 #ifdef __cplusplus
36 #if (__cplusplus < 201103L) && !defined(nullptr)
37 #define nullptr 0
38 #endif
39 #endif
40 
41 #if !defined(TEMU_NO_WRAP)
42 #define TEMU_NO_WRAP
43 #endif
44 
45 #ifndef TEMU_BUFF_DEFINED
46 #define TEMU_BUFF_DEFINED
47 typedef struct {
48  uintptr_t data0;
49  uint32_t data1;
50  uint32_t data2;
51 } temu_Buff;
52 #endif // !TEMU_BUFF_DEFINED
53 
54 #ifndef TEMU_COMPONENT_DEFINED
55 #define TEMU_COMPONENT_DEFINED
57 #endif // !TEMU_COMPONENT_DEFINED
58 
59 typedef struct temu_Class temu_Class;
60 typedef void temu_MetaIface;
61 
82 typedef struct temu_Object {
84  char *Name;
87  uint64_t LoggingFlags;
89  int64_t DisposedNotification;
91 
93  void *UserData;
94 
95  uint64_t IsClassObject : 1;
96  uint64_t IsCheckpointable : 1;
97 } temu_Object;
98 
111 typedef struct temu_IfaceRef {
113  void *Iface;
114 } temu_IfaceRef;
115 
125 typedef struct temu_IfaceRefArray {
126  uint32_t Size;
127  uint32_t Reserved;
130 
138 
147  void *Iface TEMU_NONNULL);
148 
156  temu_IfaceRef Iface);
157 
163 TEMU_API unsigned
164 temu_ifaceRefArraySize(temu_IfaceRefArray *Arr); // Return size
165 
173  unsigned idx);
174 
176 
180 #define TEMU_IFACE_REFERENCE_TYPE(N) \
181  typedef struct { \
182  temu_Object_ *Obj; \
183  N##Iface *Iface; \
184  } N##IfaceRef; \
185  typedef struct { \
186  uint32_t Size; \
187  uint32_t Reserved; \
188  N##IfaceRef *Ifaces; \
189  } N##IfaceRefArray; \
190  static inline N##IfaceRefArray N##IfaceRefArrayAlloc(unsigned Reserve) \
191  { \
192  temu_IfaceRefArray Arr = temu_ifaceRefArrayAlloc(Reserve); \
193  N##IfaceRefArray Res; \
194  Res.Size = Arr.Size; \
195  Res.Reserved = Arr.Reserved; \
196  Res.Ifaces = (N##IfaceRef *)Arr.Ifaces; \
197  return Res; \
198  } \
199  static inline void N##IfaceRefArrayDispose(N##IfaceRefArray *Arr) \
200  { \
201  temu_ifaceRefArrayDispose((temu_IfaceRefArray *)Arr); \
202  } \
203  static inline void N##IfaceRefArrayPush2(N##IfaceRefArray *Arr, \
204  temu_Object_ *Obj, void *Iface) \
205  { \
206  temu_ifaceRefArrayPush2((temu_IfaceRefArray *)Arr, Obj, Iface); \
207  } \
208  static inline void N##IfaceRefArrayPush(N##IfaceRefArray *Arr, \
209  N##IfaceRef Iface) \
210  { \
211  temu_IfaceRef Iface2; \
212  Iface2.Obj = Iface.Obj; \
213  Iface2.Iface = (void *)Iface.Iface; \
214  \
215  temu_ifaceRefArrayPush((temu_IfaceRefArray *)Arr, Iface2); \
216  } \
217  static inline unsigned N##IfaceRefArraySize(N##IfaceRefArray *Arr) \
218  { \
219  return Arr->Size; \
220  } \
221  static inline void N##IfaceRefArrayPop(N##IfaceRefArray *Arr) { Arr->Size--; }
222 
223 #define TEMU_DYN_ARRAY_TYPE(T, P) \
224  typedef struct { \
225  uint32_t Size; \
226  uint32_t Reserved; \
227  T *Values; \
228  } temu_##P##Array; \
229  static inline temu_##P##Array TEMU_MAYBE_UNUSED temu_##P##ArrayAlloc( \
230  unsigned Reserve) \
231  { \
232  assert(Reserve > 0); \
233  temu_##P##Array Arr; \
234  Arr.Size = 0; \
235  Arr.Reserved = Reserve; \
236  Arr.Values = (T *)calloc(Reserve, sizeof(T)); \
237  assert(Arr.Values); \
238  return Arr; \
239  } \
240  static inline void TEMU_MAYBE_UNUSED temu_##P##ArrayPush( \
241  temu_##P##Array *Arr, T Val) \
242  { \
243  if (Arr->Reserved >= Arr->Size) { \
244  T *NewValues = (T *)realloc(Arr->Values, Arr->Reserved * 2); \
245  if (NewValues) { \
246  Arr->Values = NewValues; \
247  } else { \
248  abort(); \
249  } \
250  } \
251  Arr->Values[Arr->Size++] = Val; \
252  } \
253  static inline unsigned TEMU_MAYBE_UNUSED temu_##P##ArraySize( \
254  temu_##P##Array *Arr) \
255  { \
256  return Arr->Size; \
257  } \
258  static inline void TEMU_MAYBE_UNUSED temu_##P##ArrayPop( \
259  temu_##P##Array *Arr) \
260  { \
261  if (Arr->Size > 0) \
262  Arr->Size--; \
263  }
264 
265 TEMU_DYN_ARRAY_TYPE(int8_t, i8)
266 TEMU_DYN_ARRAY_TYPE(int16_t, i16)
267 TEMU_DYN_ARRAY_TYPE(int32_t, i32)
268 TEMU_DYN_ARRAY_TYPE(int64_t, i64)
269 
270 TEMU_DYN_ARRAY_TYPE(uint8_t, u8)
271 TEMU_DYN_ARRAY_TYPE(uint16_t, u16)
272 TEMU_DYN_ARRAY_TYPE(uint32_t, u32)
273 TEMU_DYN_ARRAY_TYPE(uint64_t, u64)
275 
276 
282 typedef enum temu_Type {
284 
285  // C pointer sized integers
288 
289  // Standard C floating point types
292 
293  // Standard C fixed width integer types
302 
303  // Object pointer, must be saved as an object reference
305 
306  // Internal pointer, points somewhere in the object itself
307  // (e.g. bank resolution arrays) This can be saved as an offset...
309 
310  // Interface references (object and interface pointer pair)
313 
319 } temu_Type;
320 
327 typedef struct temu_Propref {
329  void *Ptr;
330 } temu_Propref;
331 
335 typedef struct {
337  const char *Name;
338 } temu_PropName;
339 
340 typedef void temu_Dict;
341 
345 typedef struct {
347  void *VecData;
348 } temu_Vector;
349 
350 typedef void temu_ListNode;
351 
355 typedef struct {
359 } temu_List;
360 
368 typedef struct temu_Propval {
370  union {
371  intptr_t IntPtr;
372  uintptr_t UIntPtr;
373 
374  float f;
375  double d;
376 
377  uint8_t u8;
378  uint16_t u16;
379  uint32_t u32;
380  uint64_t u64;
381 
382  int8_t i8;
383  int16_t i16;
384  int32_t i32;
385  int64_t i64;
386 
390  const char *String;
395  };
396 } temu_Propval;
397 
411 typedef struct temu_CreateArg {
412  const char *Key;
415 
416 #define TEMU_NULL_ARG \
417  { \
418  NULL, { teTY_Invalid } \
419  }
420 
421 typedef void *(*temu_ObjectCreateFunc)(const char *Name, int Argc,
422  const temu_CreateArg *Argv);
423 typedef void (*temu_ObjectDisposeFunc)(void *);
424 
435 struct temu_Class {
437  void *Impl;
438  void *VTable;
441  const char *LoggingCategories[32]; // Named logging categories.
442 };
443 
444 // Dictionary support. Dictionaries are data structure that contain
445 // named prop values. They are not meant for high performing code, but
446 // are useful for advanced configuration capabilities. In practice
447 // dictionaries work for any type, but snapshots will not yet work
448 // for entries containing complex types (temu_Buff, temu_Vector and
449 // other dictionaries). This will be addressed in the future.
450 
456 
463 
473 TEMU_API int temu_dictInsertValue(temu_Dict *Dict, const char *Name,
474  temu_Propval Val);
475 
483 TEMU_API temu_Propval temu_dictGetValue(temu_Dict *Dict, const char *Name);
484 
493 TEMU_API int temu_dictRemoveValue(temu_Dict *Dict, const char *Name);
494 
503 TEMU_API const char *temu_dictGetNextKey(temu_Dict *Dict, const char *Key);
504 
505 // Typed vector support. The typed vectors can be described as a C++
506 // std::vector, however, they are expressed as a C-API here and
507 // supports snapshots.
508 
516 
523 
531 
539 
547 
555 
562 
570 
578 
586 
594 
602 
610 
618 
626 
634 
635 #ifdef PROP_ASSERTS_ENABLED
636 #define PROP_ASSERT(p, t) assert(p.Typ == t && "invalid property type")
637 #else
638 #define PROP_ASSERT(p, t)
639 #endif
640 
641 // This is not the nicest solution,
642 // but we want to be compatible with C++ and C99, meaning:
643 // - cannot use designated initializers (C99, not C++)
644 // - cannot use constructors (C++, not C99)
645 
646 #define PROP_VAL_INITIALIZER(typ, suffix, typetag, valtag) \
647  static inline temu_Propval temu_makeProp##suffix(typ val) \
648  { \
649  temu_Propval pv; \
650  pv.Typ = typetag; \
651  pv.valtag = val; \
652  return pv; \
653  } \
654  static inline typ temu_propValue##suffix(temu_Propval pv) \
655  { \
656  PROP_ASSERT(pv.Typ, typetag); \
657  typ val = pv.valtag; \
658  return val; \
659  }
660 
661 PROP_VAL_INITIALIZER(intptr_t, IntPtr, teTY_Intptr, IntPtr)
662 PROP_VAL_INITIALIZER(uintptr_t, UIntPtr, teTY_Uintptr, UIntPtr)
663 
664 PROP_VAL_INITIALIZER(float, Float, teTY_Float, f)
665 PROP_VAL_INITIALIZER(double, Double, teTY_Double, d)
666 
667 PROP_VAL_INITIALIZER(uint8_t, U8, teTY_U8, u8)
668 PROP_VAL_INITIALIZER(uint16_t, U16, teTY_U16, u16)
669 PROP_VAL_INITIALIZER(uint32_t, U32, teTY_U32, u32)
670 PROP_VAL_INITIALIZER(uint64_t, U64, teTY_U64, u64)
671 
672 PROP_VAL_INITIALIZER(int8_t, I8, teTY_I8, i8)
673 PROP_VAL_INITIALIZER(int16_t, I16, teTY_I16, i16)
674 PROP_VAL_INITIALIZER(int32_t, I32, teTY_I32, i32)
675 PROP_VAL_INITIALIZER(int64_t, I64, teTY_I64, i64)
676 
679 PROP_VAL_INITIALIZER(const char *, String, teTY_String, String)
680 
681 
687 typedef void (*temu_PropWriter)(void *Obj, temu_Propval Pv, int Idx);
688 
695 typedef temu_Propval (*temu_PropReader)(void *Obj, int Idx);
696 
707  const char *PropName);
708 
720  const char *PropName);
721 
729 TEMU_API int temu_getPropLength(const temu_Object_ *Obj, const char *PropName);
730 
743  const char *PropName);
744 
753  const char *PropName);
754 
762 TEMU_API int temu_objectHasProp(const temu_Object_ *Obj, const char *PropName);
763 
773  const char *IfaceName);
774 
782 
790 
798 
801 
809 
817 
825 
833 
842 TEMU_API temu_Propval temu_getValue(temu_Object_ *Obj, const char *PropName,
843  int Idx) TEMU_NO_WRAP;
844 
853 TEMU_API uint8_t temu_getValueU8(temu_Object_ *Obj, const char *PropName,
854  int Idx);
855 
864 TEMU_API uint16_t temu_getValueU16(temu_Object_ *Obj, const char *PropName,
865  int Idx);
866 
875 TEMU_API uint32_t temu_getValueU32(temu_Object_ *Obj, const char *PropName,
876  int Idx);
877 
886 TEMU_API uint64_t temu_getValueU64(temu_Object_ *Obj, const char *PropName,
887  int Idx);
888 
897 TEMU_API int8_t temu_getValueI8(temu_Object_ *Obj, const char *PropName,
898  int Idx);
899 
908 TEMU_API int16_t temu_getValueI16(temu_Object_ *Obj, const char *PropName,
909  int Idx);
910 
919 TEMU_API int32_t temu_getValueI32(temu_Object_ *Obj, const char *PropName,
920  int Idx);
921 
930 TEMU_API int64_t temu_getValueI64(temu_Object_ *Obj, const char *PropName,
931  int Idx);
932 
943 TEMU_API temu_Propval temu_readValue(temu_Object_ *Obj, const char *PropName,
944  int Idx) TEMU_NO_WRAP;
945 
959 TEMU_API uint8_t temu_readValueU8(temu_Object_ *Obj, const char *PropName,
960  int Idx);
961 
975 TEMU_API uint16_t temu_readValueU16(temu_Object_ *Obj, const char *PropName,
976  int Idx);
977 
991 TEMU_API uint32_t temu_readValueU32(temu_Object_ *Obj, const char *PropName,
992  int Idx);
993 
1007 TEMU_API uint64_t temu_readValueU64(temu_Object_ *Obj, const char *PropName,
1008  int Idx);
1009 
1023 TEMU_API int8_t temu_readValueI8(temu_Object_ *Obj, const char *PropName,
1024  int Idx);
1025 
1039 TEMU_API int16_t temu_readValueI16(temu_Object_ *Obj, const char *PropName,
1040  int Idx);
1041 
1055 TEMU_API int32_t temu_readValueI32(temu_Object_ *Obj, const char *PropName,
1056  int Idx);
1057 
1071 TEMU_API int64_t temu_readValueI64(temu_Object_ *Obj, const char *PropName,
1072  int Idx);
1073 
1082 TEMU_API void temu_setValue(temu_Object_ *Obj, const char *PropName,
1083  temu_Propval Val, int Idx) TEMU_NO_WRAP;
1084 
1093 TEMU_API void temu_setValueU8(temu_Object_ *Obj, const char *PropName,
1094  uint8_t Val, int Idx);
1095 
1104 TEMU_API void temu_setValueU16(temu_Object_ *Obj, const char *PropName,
1105  uint16_t Val, int Idx);
1106 
1115 TEMU_API void temu_setValueU32(temu_Object_ *Obj, const char *PropName,
1116  uint32_t Val, int Idx);
1117 
1126 TEMU_API void temu_setValueU64(temu_Object_ *Obj, const char *PropName,
1127  uint64_t Val, int Idx);
1128 
1137 TEMU_API void temu_setValueI8(temu_Object_ *Obj, const char *PropName,
1138  int8_t Val, int Idx);
1139 
1148 TEMU_API void temu_setValueI16(temu_Object_ *Obj, const char *PropName,
1149  int16_t Val, int Idx);
1150 
1159 TEMU_API void temu_setValueI32(temu_Object_ *Obj, const char *PropName,
1160  int32_t Val, int Idx);
1161 
1170 TEMU_API void temu_setValueI64(temu_Object_ *Obj, const char *PropName,
1171  int64_t Val, int Idx);
1172 
1181 TEMU_API void temu_writeValue(temu_Object_ *Obj, const char *PropName,
1182  temu_Propval Val, int Idx) TEMU_NO_WRAP;
1183 
1192 TEMU_API void temu_writeValueU8(temu_Object_ *Obj, const char *PropName,
1193  uint8_t Val, int Idx);
1194 
1203 TEMU_API void temu_writeValueU16(temu_Object_ *Obj, const char *PropName,
1204  uint16_t Val, int Idx);
1205 
1214 TEMU_API void temu_writeValueU32(temu_Object_ *Obj, const char *PropName,
1215  uint32_t Val, int Idx);
1216 
1225 TEMU_API void temu_writeValueU64(temu_Object_ *Obj, const char *PropName,
1226  uint64_t Val, int Idx);
1227 
1236 TEMU_API void temu_writeValueI8(temu_Object_ *Obj, const char *PropName,
1237  int8_t Val, int Idx);
1238 
1247 TEMU_API void temu_writeValueI16(temu_Object_ *Obj, const char *PropName,
1248  int16_t Val, int Idx);
1249 
1258 TEMU_API void temu_writeValueI32(temu_Object_ *Obj, const char *PropName,
1259  int32_t Val, int Idx);
1260 
1269 TEMU_API void temu_writeValueI64(temu_Object_ *Obj, const char *PropName,
1270  int64_t Val, int Idx);
1271 
1284 TEMU_API temu_Class *temu_registerClass(const char *ClsName,
1285  temu_ObjectCreateFunc Create,
1286  temu_ObjectDisposeFunc Dispose);
1287 
1288 #ifdef __cplusplus
1289 
1308 TEMU_API void temu_addProperty(temu_Class *Cls, const char *PropName,
1309  int Offset, temu_Type Typ, int Count,
1310  temu_PropWriter Wr = nullptr,
1311  temu_PropReader Rd = nullptr,
1312  const char *Doc = "");
1313 #else
1314 
1333 TEMU_API void temu_addProperty(temu_Class *Cls, const char *PropName,
1334  int Offset, temu_Type Typ, int Count,
1336  const char *Doc);
1337 
1338 #endif
1339 
1367 TEMU_API void temu_addPseudoProperty(temu_Class *Cls, const char *PropName,
1368  temu_Type Typ, int Count,
1371  const char *Doc);
1372 
1381 TEMU_API int temu_addLoggingCategory(temu_Class *Cls, unsigned CategoryId,
1382  const char *Category);
1383 
1392  unsigned CategoryId);
1393 
1401 TEMU_API int temu_isPseudoProperty(temu_Object_ *Obj, const char *PropName);
1402 
1411 TEMU_API int temu_isNormalProperty(temu_Object_ *Obj, const char *PropName);
1412 
1424 TEMU_API void temu_requireInterface(temu_Class *Cls, const char *PropName,
1425  const char *IfaceType);
1426 
1445 TEMU_API void temu_addInterfaceReference(temu_Class *Cls, const char *PropName,
1446  int Offset, const char *TypeName,
1447  int Count, unsigned Flags,
1449  const char *Doc);
1450 
1451 
1469 TEMU_API void temu_addPseudoInterfaceReference(temu_Class *Cls, const char *PropName,
1470  const char *TypeName, int Count, unsigned Flags,
1473  const char *Doc);
1474 
1493 TEMU_API int temu_addPort(temu_Class *C, const char *IfaceRefName,
1494  const char *IfaceName, const char *Doc);
1495 
1504 #ifdef __cplusplus
1505 
1518 TEMU_API void temu_addInterface(temu_Class *Cls, const char *IfaceName,
1519  const char *IfaceType, void *Iface,
1520  int DeprecatedParam = 0, const char *Doc = "");
1521 
1531 TEMU_API void *temu_getInterface(temu_Object_ *Obj, const char *IfaceName,
1532  int Idx = 0);
1533 
1534 #else
1536 
1537  const char *IfaceName, const char *IfaceType,
1538  void *Iface, int DeprecatedParam,
1539  const char *Doc);
1540 
1541 TEMU_API void *temu_getInterface(temu_Object_ *Obj, const char *IfaceName,
1542  int Idx);
1543 
1544 #endif
1545 
1555  const char *IfaceName, int Idx);
1556 
1564 TEMU_API const char *temu_getInterfaceName(temu_Object *Obj, void *Iface);
1565 
1584 TEMU_API void temu_addInterfaceArray(temu_Class *Cls, const char *IfaceName,
1585  const char *IfaceType, void *Iface,
1586  size_t Count, size_t Size,
1587  const char *Doc);
1588 
1602 TEMU_API int temu_setVTable(temu_Class *Cls, void *VTable);
1603 
1611 
1619 TEMU_API void *temu_getVTable(const temu_Object_ *Obj);
1620 
1629 
1630 /*
1631  * Qualification support
1632  *
1633  * Qualifiers can set a tag per class, which can then be used for
1634  * quick identification of an object's class properties. For example
1635  * all objects qualified as CPUs, machines and memories must have the
1636  * vtable set appropriatelly.
1637  */
1638 #define TEMU_QUAL_NONE 0
1639 #define TEMU_QUAL_CPU 1
1640 #define TEMU_QUAL_MACHINE 2
1641 #define TEMU_QUAL_MEMORY 4
1642 #define TEMU_QUAL_COMPONENT 5
1643 #define TEMU_QUAL_CLOCK 6
1644 
1645 // Users can set their own class qualifiers, but should use an offset
1646 // from the TEMU_QUAL_USER.
1647 #define TEMU_QUAL_USER 65536
1648 
1656 TEMU_API int temu_isQualifiedAs(const temu_Object_ *Obj, unsigned Qualifier);
1657 
1665 TEMU_API int temu_isCpu(const temu_Object_ *Obj);
1666 
1674 TEMU_API int temu_isMachine(const temu_Object_ *Obj);
1675 
1682 TEMU_API int temu_isMemory(const temu_Object_ *Obj);
1683 
1690 TEMU_API int temu_isComponent(const temu_Object_ *Obj);
1691 
1700 
1709 
1716 
1723 TEMU_API void temu_qualifyAs(temu_Class *Cls, unsigned Qualifier);
1724 
1728 TEMU_API void temu_objsysClear(void);
1729 
1733 
1747 TEMU_API temu_Object_ *temu_createObject(const char *ClsName,
1748  const char *ObjName,
1749  const temu_CreateArg *Args);
1750 
1757 
1764 TEMU_API temu_Class *temu_classForName(const char *ClsName);
1765 
1772 TEMU_API const char *temu_nameForClass(temu_Class *Cls);
1773 
1781 
1789 TEMU_API int temu_classHasCommand(const temu_Class *Cls, const char *CmdName);
1790 
1791 typedef void temu_TypeObject;
1792 
1793 typedef struct {
1794  const char *Name;
1796  size_t Count;
1797  uintptr_t Offset;
1799 } temu_PropInfo;
1800 
1828 TEMU_API int temu_propInfoForClass(temu_Class *Cls, unsigned PIIndex,
1829  unsigned PICount, temu_PropInfo *PI);
1830 
1837 TEMU_API temu_Object_ *temu_objectForName(const char *Name);
1838 
1845 TEMU_API const char *temu_nameForObject(const temu_Object_ *Obj);
1846 
1854 TEMU_API const char *temu_nameForInterface(const temu_Object_ *Obj,
1855  const void *Iface);
1856 
1866 TEMU_API int temu_indexForInterface(const temu_Object_ *Obj, const void *Iface);
1867 
1875 TEMU_API const char *temu_typenameForInterface(const temu_Object_ *Obj,
1876  const void *Iface);
1877 
1898 TEMU_API int temu_loadPlugin(const char *PluginName);
1899 
1906 TEMU_API void temu_pluginPathAppend(const char *Path);
1907 
1914 TEMU_API void temu_pluginPathRemove(const char *Path);
1915 
1920 TEMU_API void temu_pluginPathPrint(void);
1921 
1928 TEMU_API const char *temu_typeToName(temu_Type Typ);
1929 
1930 /* NOTE: The getProcessors, getProcsessorCount, getComponents and
1931  getComponentCount functions are experimental and unstable. Do not
1932  rely on these for the moment.
1933 */
1941 
1947 TEMU_API size_t temu_getProcessorCount(void);
1948 
1956 
1962 TEMU_API size_t temu_getComponentCount(void);
1963 
1978 TEMU_API int temu_connect(temu_Object_ *A, const char *PropName,
1979  temu_Object_ *B, const char *IfaceName);
1980 
1995 TEMU_API int temu_serialiseJSON(const char *FileName);
1996 
2009 TEMU_API int temu_deserialiseJSON(const char *FileName);
2010 
2024 TEMU_API int temu_inlineDeserialiseJSON(const char *FileName);
2025 
2026 
2041 TEMU_API void temu_serialiseProp(void *Ctxt, const char *Name, temu_Type Typ,
2042  int Count, void *Data);
2043 
2053 TEMU_API void temu_deserialiseProp(void *Ctxt, temu_Object_ *Obj,
2054  const char *Name);
2055 
2063 TEMU_API int temu_snapshotGetLength(void *Ctxt, const char *Name);
2071 TEMU_API int temu_checkpointGetLength(void *Ctxt, const char *Name);
2072 
2081 TEMU_API temu_Propval temu_snapshotGetValue(void *Ctxt, const char *Name,
2082  int Idx);
2083 
2092 TEMU_API temu_Propval temu_checkpointGetValue(void *Ctxt, const char *Name,
2093  int Idx);
2094 
2107 TEMU_API int temu_checkSanity(int Report);
2108 
2122 TEMU_API int temu_generateObjectGraph(const char *Path, int Display);
2123 
2124 TEMU_API int temu_isValidObjectName(const char *Name);
2125 TEMU_API int temu_isValidClassName(const char *Name);
2126 TEMU_API int temu_isValidInterfaceName(const char *Name);
2127 TEMU_API int temu_isValidPropertyName(const char *Name);
2128 
2133 typedef struct {
2142  void (*serialise)(void *Obj, const char *BaseName, void *Ctxt);
2143 
2153  void (*deserialise)(void *Obj, const char *BaseName, void *Ctxt);
2154 
2161  int (*checkSanity)(void *Obj, int Report); // Optional
2162 
2169  void (*timeSourceSet)(void *Obj);
2170 
2177  void (*printObject)(void *Obj);
2179 #define TEMU_OBJECT_IFACE_TYPE "ObjectIface"
2181 
2182 
2190 TEMU_API void temu_foreachObject(void (*Func)(temu_Object_ *, void *),
2191  void *Arg);
2192 
2201 TEMU_API void temu_foreachClass(void (*Func)(temu_Class *, void *), void *Arg);
2202 
2211 TEMU_API void temu_foreachProcessor(void (*Func)(temu_Object_ *, void *),
2212  void *Arg);
2213 
2225  temu_Class *C, void (*Func)(temu_Class *, const char *, void *), void *Arg);
2226 
2238  temu_Class *C, void (*Func)(temu_Class *, const char *, void *), void *Arg);
2239 
2240 TEMU_API void *temu_registerInterfaceType(const char *Name);
2241 TEMU_API void *temu_getInterfaceType(const char *Name);
2242 
2250 TEMU_API int temu_addScalarProperty(temu_Class *Cls, const char *Name,
2251  int offset, temu_Type T,
2252  const char *Doc);
2261 TEMU_API int temu_addArrayProperty(temu_Class *Cls, const char *Name,
2262  int offset, temu_Type T, int NumElems,
2263  const char *Doc);
2264 
2271 TEMU_API int temu_addScalarPseudoProperty(temu_Class *Cls, const char *Name,
2272  temu_Type T, const char *Doc);
2273 
2281 TEMU_API int temu_addArrayPseudoProperty(temu_Class *Cls, const char *Name,
2282  temu_Type T, int NumElems,
2283  const char *Doc);
2284 
2291 TEMU_API int temu_writeProp(temu_Object_ *Obj, const char *Name, int idx,
2292  temu_Propval *PV);
2293 
2299 TEMU_API temu_Propval temu_readProp(temu_Object_ *Obj, const char *Name,
2300  int idx);
2301 
2307 TEMU_API uint64_t temu_getValueUnsigned(temu_Object_ *Obj, const char *PropName,
2308  int Idx);
2314 TEMU_API int64_t temu_getValueSigned(temu_Object_ *Obj, const char *PropName,
2315  int Idx);
2316 
2322 TEMU_API double temu_getValueDouble(temu_Object_ *Obj, const char *PropName,
2323  int Idx);
2330  const char *PropName,
2331  int Idx);
2337 TEMU_API int64_t temu_readValueSigned(temu_Object_ *Obj, const char *PropName,
2338  int Idx);
2344 TEMU_API double temu_readValueDouble(temu_Object_ *Obj, const char *PropName,
2345  int Idx);
2346 
2352 TEMU_API void temu_setValueUnsigned(temu_Object_ *Obj, const char *PropName,
2353  uint64_t Val, int Idx);
2359 TEMU_API void temu_setValueSigned(temu_Object_ *Obj, const char *PropName,
2360  int64_t Val,
2361  int Idx);
2367 TEMU_API void temu_setValueDouble(temu_Object_ *Obj, const char *PropName,
2368  double Val,
2369  int Idx);
2375 TEMU_API void temu_writeValueUnsigned(temu_Object_ *Obj, const char *PropName,
2376  uint64_t Val, int Idx);
2382 TEMU_API void temu_writeValueSigned(temu_Object_ *Obj, const char *PropName,
2383  int64_t Val,
2384  int Idx);
2390 TEMU_API void temu_writeValueDouble(temu_Object_ *Obj, const char *PropName,
2391  double Val,
2392  int Idx);
2393 
2394 
2416 
2423 TEMU_API int temu_objectHasCmd(const temu_Object_ *Obj, const char *CmdName);
2424 
2425 #ifdef __cplusplus
2426 }
2427 #endif
2428 
2429 #endif
temu_ObjectDisposeFunc Dispose
Destructor / dispose function for disposing instances of the class.
Definition: Objsys.h:440
TEMU_API void temu_writeValueUnsigned(temu_Object_ *Obj, const char *PropName, uint64_t Val, int Idx)
TEMU_API temu_Propval temu_unsignedPropval(temu_Type T, uint64_t U)
TEMU_API void temu_writeValue(temu_Object_ *Obj, const char *PropName, temu_Propval Val, int Idx) TEMU_NO_WRAP
int8_t i8
Definition: Objsys.h:382
TEMU_API void temu_qualifyAsCpu(temu_Class *Cls)
void temu_MetaIface
Definition: Objsys.h:60
TEMU_API size_t temu_vecGetSize(temu_Vector *Vec)
temu_Type Typ
Type of vector data.
Definition: Objsys.h:346
16-bit fixed width unsigned integer
Definition: Objsys.h:295
struct temu_Propref temu_Propref
void(* temu_PropWriter)(void *Obj, temu_Propval Pv, int Idx)
Definition: Objsys.h:687
TEMU_API int temu_inlineDeserialiseJSON(const char *FileName)
TEMU_API temu_List temu_listCreate(temu_Type Typ)
TEMU_API int temu_getPropLength(const temu_Object_ *Obj, const char *PropName)
Definition: Objsys.h:1793
Single precision floating point value.
Definition: Objsys.h:290
const char * String
Definition: Objsys.h:390
#define TEMU_IFACE_REFERENCE_TYPE(N)
Definition: Objsys.h:180
TEMU_API uint8_t temu_getValueU8(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API void temu_writeValueU64(temu_Object_ *Obj, const char *PropName, uint64_t Val, int Idx)
TEMU_API temu_IfaceRef temu_getInterfaceRef(temu_Object_ *Obj, const char *IfaceName, int Idx)
TEMU_API int8_t temu_readValueI8(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API int64_t temu_getValueSigned(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API int temu_getPropDynLength(const temu_Object_ *Obj, const char *PropName)
TEMU_API int temu_objectHasProp(const temu_Object_ *Obj, const char *PropName)
TEMU_API int temu_propInfoForClass(temu_Class *Cls, unsigned PIIndex, unsigned PICount, temu_PropInfo *PI)
TEMU_API int32_t temu_readValueI32(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API int temu_deserialiseJSON(const char *FileName)
TEMU_API int temu_isSigned(temu_Propval Pv)
TEMU_API void temu_addPseudoInterfaceReference(temu_Class *Cls, const char *PropName, const char *TypeName, int Count, unsigned Flags, temu_PropWriter Wr, temu_PropReader Rd, temu_PropWriter Set, temu_PropReader Get, const char *Doc)
TEMU_API void temu_qualifyAsMachine(temu_Class *Cls)
temu_Type Typ
Element type in list.
Definition: Objsys.h:356
uint64_t IsClassObject
The object is a class object.
Definition: Objsys.h:95
TEMU_API int temu_objectHasCmd(const temu_Object_ *Obj, const char *CmdName)
temu_ListNode * Tail
Managed pointer, do not use directly.
Definition: Objsys.h:358
Definition: Objsys.h:335
#define TEMU_NONNULL
Definition: Attributes.h:48
TEMU_API void temu_objsysClearObjects(void)
Definition: Objsys.h:327
TEMU_API int temu_isReal(temu_Propval Pv)
temu_Type Typ
Type tag.
Definition: Objsys.h:1795
TEMU_API void temu_vecPush(temu_Vector *Vec, temu_Propval Val)
uint16_t u16
Definition: Objsys.h:378
TEMU_API temu_Propval temu_dictGetValue(temu_Dict *Dict, const char *Name)
TEMU_API void temu_writeValueU32(temu_Object_ *Obj, const char *PropName, uint32_t Val, int Idx)
void * UserData
User data pointer. This is not saved in snapshots.
Definition: Objsys.h:93
Interface reference.
Definition: Objsys.h:311
TEMU_API temu_Propval temu_getValue(temu_Object_ *Obj, const char *PropName, int Idx) TEMU_NO_WRAP
TEMU_API int64_t temu_readValueSigned(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API int temu_writeProp(temu_Object_ *Obj, const char *Name, int idx, temu_Propval *PV)
uint64_t u64
Definition: Objsys.h:380
32-bit fixed width signed integer
Definition: Objsys.h:300
TEMU_API int temu_serialiseJSON(const char *FileName)
TEMU_API int temu_isComponent(const temu_Object_ *Obj)
TEMU_API int temu_loadPlugin(const char *PluginName)
TEMU_API void temu_addProperty(temu_Class *Cls, const char *PropName, int Offset, temu_Type Typ, int Count, temu_PropWriter Wr, temu_PropReader Rd, const char *Doc)
TEMU_API void temu_writeValueU8(temu_Object_ *Obj, const char *PropName, uint8_t Val, int Idx)
TEMU_API void temu_foreachClass(void(*Func)(temu_Class *, void *), void *Arg)
TEMU_API void temu_disposeObject(temu_Object_ *Obj)
TEMU_API void temu_setValueU64(temu_Object_ *Obj, const char *PropName, uint64_t Val, int Idx)
TEMU_API void temu_vecDispose(temu_Vector *Vec)
TEMU_API int temu_isCpu(const temu_Object_ *Obj)
TEMU_API double temu_getValueDouble(temu_Object_ *Obj, const char *PropName, int Idx)
const char * Name
Property name.
Definition: Objsys.h:337
TEMU_API const char * temu_getInterfaceName(temu_Object *Obj, void *Iface)
64-bit fixed width unsigned integer
Definition: Objsys.h:297
TEMU_API void temu_setValueDouble(temu_Object_ *Obj, const char *PropName, double Val, int Idx)
TEMU_API void temu_qualifyAsMemory(temu_Class *Cls)
TEMU_API temu_IfaceRef temu_ifaceRefArrayGet(temu_IfaceRefArray *Arr, unsigned idx)
int16_t i16
Definition: Objsys.h:383
TEMU_API int64_t temu_readValueI64(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API int temu_indexForInterface(const temu_Object_ *Obj, const void *Iface)
const char * Key
Name of argument.
Definition: Objsys.h:412
TEMU_API int temu_snapshotGetLength(void *Ctxt, const char *Name)
intptr_t IntPtr
Definition: Objsys.h:371
TEMU_API void temu_setValue(temu_Object_ *Obj, const char *PropName, temu_Propval Val, int Idx) TEMU_NO_WRAP
TEMU_API temu_Propval temu_floatingPointPropval(temu_Type T, double V)
#define TEMU_NO_WRAP
Definition: Objsys.h:42
TEMU_API temu_ListNode * temu_listGetTail(temu_List *List)
temu_IfaceRef IfaceRef
Definition: Objsys.h:388
TEMU_API void temu_listPrepend(temu_List *List, temu_Propval Val)
TEMU_API temu_Propval temu_listNodeGetVal(temu_ListNode *Node)
char * Name
Object name.
Definition: Objsys.h:84
int64_t WillDisposeNotification
Definition: Objsys.h:88
TEMU_API int temu_isUnsigned(temu_Propval Pv)
int32_t i32
Definition: Objsys.h:384
16-bit fixed width signed integer
Definition: Objsys.h:299
TEMU_API const char * temu_typeToName(temu_Type Typ)
TEMU_API void temu_pluginPathRemove(const char *Path)
TEMU_API void temu_writeValueI32(temu_Object_ *Obj, const char *PropName, int32_t Val, int Idx)
TEMU_API int temu_isValidPropertyName(const char *Name)
TEMU_API uint8_t temu_readValueU8(temu_Object_ *Obj, const char *PropName, int Idx)
void *(* temu_ObjectCreateFunc)(const char *Name, int Argc, const temu_CreateArg *Argv)
Definition: Objsys.h:421
temu_Object_ * Obj
Definition: Objsys.h:387
TEMU_API void * temu_getInterfaceType(const char *Name)
void * Impl
Internal pointer, do not touch.
Definition: Objsys.h:437
uint8_t u8
Definition: Objsys.h:377
TEMU_API temu_Propval temu_signedPropval(temu_Type T, int64_t I)
TEMU_API void temu_addInterface(temu_Class *Cls, const char *IfaceName, const char *IfaceType, void *Iface, int DeprecatedParam, const char *Doc)
uint32_t Size
Number of used items in array.
Definition: Objsys.h:126
temu_Propval(* temu_PropReader)(void *Obj, int Idx)
Definition: Objsys.h:695
TEMU_API temu_Class * temu_classForObject(const temu_Object_ *Obj)
TEMU_API int temu_dictInsertValue(temu_Dict *Dict, const char *Name, temu_Propval Val)
Invalid value 0.
Definition: Objsys.h:283
TEMU_API void temu_listDispose(temu_List *List)
TEMU_API uint64_t temu_getValueUnsigned(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API int16_t temu_readValueI16(temu_Object_ *Obj, const char *PropName, int Idx)
temu_Type
Definition: Objsys.h:282
temu_Vector Vector
Definition: Objsys.h:393
struct temu_Component temu_Component
Definition: Component.h:27
double d
Definition: Objsys.h:375
TEMU_API void temu_setValueI64(temu_Object_ *Obj, const char *PropName, int64_t Val, int Idx)
TEMU_API const char * temu_typenameForInterface(const temu_Object_ *Obj, const void *Iface)
TEMU_API void temu_addPseudoProperty(temu_Class *Cls, const char *PropName, temu_Type Typ, int Count, temu_PropWriter Wr, temu_PropReader Rd, temu_PropWriter Set, temu_PropReader Get, const char *Doc)
void temu_Dict
Definition: Objsys.h:340
uint64_t LoggingFlags
Log category enabled/disabled.
Definition: Objsys.h:87
TEMU_API int temu_classHasCommand(const temu_Class *Cls, const char *CmdName)
struct temu_CreateArg temu_CreateArg
TEMU_API int temu_addPort(temu_Class *C, const char *IfaceRefName, const char *IfaceName, const char *Doc)
TEMU_API temu_Object_ ** temu_getProcessors(void)
Dictionary.
Definition: Objsys.h:316
void * Iface
Type erased interface pointer.
Definition: Objsys.h:113
TEMU_API int temu_isMemory(const temu_Object_ *Obj)
#define TEMU_API
Definition: Attributes.h:53
float f
Definition: Objsys.h:374
#define PROP_VAL_INITIALIZER(typ, suffix, typetag, valtag)
Definition: Objsys.h:646
TEMU_API void temu_deserialiseProp(void *Ctxt, temu_Object_ *Obj, const char *Name)
TEMU_API void temu_setValueSigned(temu_Object_ *Obj, const char *PropName, int64_t Val, int Idx)
Definition: Objsys.h:435
TEMU_API temu_Propref temu_getPropref(const temu_Object_ *Obj, const char *PropName)
TEMU_API void temu_requireInterface(temu_Class *Cls, const char *PropName, const char *IfaceType)
TEMU_API temu_Class * temu_classForName(const char *ClsName)
TEMU_API temu_ListNode * temu_listGetPrev(temu_ListNode *Node)
TEMU_API uint64_t temu_getValueU64(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API void * temu_getVTableForClass(temu_Class *Cls)
TEMU_API const char * temu_nameForInterface(const temu_Object_ *Obj, const void *Iface)
TEMU_API void temu_objsysClear(void)
temu_Object_ * Obj
Object pointer.
Definition: Objsys.h:336
TEMU_API int temu_addScalarProperty(temu_Class *Cls, const char *Name, int offset, temu_Type T, const char *Doc)
TEMU_API int temu_setVTable(temu_Class *Cls, void *VTable)
TEMU_API unsigned temu_ifaceRefArraySize(temu_IfaceRefArray *Arr)
const char * LoggingCategories[32]
Definition: Objsys.h:441
TEMU_API temu_Type temu_getPropType(const temu_Object_ *Obj, const char *PropName)
TEMU_API temu_Dict * temu_dictCreate(void)
TEMU_API const char * temu_nameForObject(const temu_Object_ *Obj)
Definition: Objsys.h:125
TEMU_API void temu_writeValueDouble(temu_Object_ *Obj, const char *PropName, double Val, int Idx)
TEMU_API const char * temu_getLoggingCategory(temu_Class *Cls, unsigned CategoryId)
TEMU_API uint16_t temu_readValueU16(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API temu_Object_ * temu_objectForName(const char *Name)
void * Ptr
Pointer to property.
Definition: Objsys.h:329
TEMU_API temu_Vector temu_vecCreate(temu_Type Typ)
TEMU_API temu_Object_ * temu_createObject(const char *ClsName, const char *ObjName, const temu_CreateArg *Args)
temu_IfaceRefArray IfaceRefArray
Definition: Objsys.h:389
Double precision floating point value.
Definition: Objsys.h:291
TEMU_API void * temu_vecGetData(temu_Vector *Vec)
TEMU_API int temu_isValidClassName(const char *Name)
size_t Count
Number of elements in property.
Definition: Objsys.h:1796
TEMU_API uint64_t temu_asUnsigned(temu_Propval Pv)
TEMU_API temu_Propval temu_listRemoveTail(temu_List *List)
TEMU_API void temu_setValueU32(temu_Object_ *Obj, const char *PropName, uint32_t Val, int Idx)
struct temu_Object temu_Object
TEMU_API void temu_writeValueU16(temu_Object_ *Obj, const char *PropName, uint16_t Val, int Idx)
Definition: Objsys.h:82
temu_TypeObject * TypeObj
Definition: Objsys.h:1798
TEMU_API void temu_foreachObject(void(*Func)(temu_Object_ *, void *), void *Arg)
#define TEMU_DYN_ARRAY_TYPE(T, P)
Definition: Objsys.h:223
temu_IfaceRef * Ifaces
Interface references.
Definition: Objsys.h:128
Definition: Objsys.h:355
8-bit fixed width unsigned integer
Definition: Objsys.h:294
TEMU_API void temu_setValueUnsigned(temu_Object_ *Obj, const char *PropName, uint64_t Val, int Idx)
TEMU_API temu_Propval temu_readValue(temu_Object_ *Obj, const char *PropName, int Idx) TEMU_NO_WRAP
struct temu_Propval temu_Propval
TEMU_API uint64_t temu_readValueU64(temu_Object_ *Obj, const char *PropName, int Idx)
#define temu_Object_
Definition: Temu2Compat.h:13
TEMU_API int temu_checkpointGetLength(void *Ctxt, const char *Name)
TEMU_API int temu_isQualifiedAs(const temu_Object_ *Obj, unsigned Qualifier)
TEMU_API void * temu_getVTable(const temu_Object_ *Obj)
List.
Definition: Objsys.h:318
TEMU_API void temu_writeValueI16(temu_Object_ *Obj, const char *PropName, int16_t Val, int Idx)
Pointer to temu_Object.
Definition: Objsys.h:304
TEMU_API int temu_checkSanity(int Report)
TEMU_API int temu_isNormalProperty(temu_Object_ *Obj, const char *PropName)
Internal pointer.
Definition: Objsys.h:308
temu_Object Super
Super class of the class instance.
Definition: Objsys.h:436
uint32_t u32
Definition: Objsys.h:379
TEMU_API void temu_setValueI32(temu_Object_ *Obj, const char *PropName, int32_t Val, int Idx)
TEMU_API int temu_isValidObjectName(const char *Name)
C-string, useful for serialization.
Definition: Objsys.h:314
uint64_t IsCheckpointable
The object is snapshottable.
Definition: Objsys.h:96
TEMU_API int temu_objectHasIface(const temu_Object_ *Obj, const char *IfaceName)
TEMU_API int16_t temu_getValueI16(temu_Object_ *Obj, const char *PropName, int Idx)
int64_t DisposedNotification
Definition: Objsys.h:90
TEMU_API void temu_foreachProperty(temu_Class *C, void(*Func)(temu_Class *, const char *, void *), void *Arg)
TEMU_API temu_Propval temu_readProp(temu_Object_ *Obj, const char *Name, int idx)
TEMU_API void temu_qualifyAs(temu_Class *Cls, unsigned Qualifier)
TEMU_API size_t temu_getComponentCount(void)
struct temu_IfaceRefArray temu_IfaceRefArray
32-bit fixed width unsigned integer
Definition: Objsys.h:296
TEMU_API int temu_dictRemoveValue(temu_Dict *Dict, const char *Name)
8-bit fixed width signed integer
Definition: Objsys.h:298
TEMU_API int temu_isValidInterfaceName(const char *Name)
TEMU_API void temu_setValueI8(temu_Object_ *Obj, const char *PropName, int8_t Val, int Idx)
void temu_ListNode
Definition: Objsys.h:350
TEMU_API int temu_isMachine(const temu_Object_ *Obj)
const char * Name
Name of property.
Definition: Objsys.h:1794
temu_Type Typ
Type of property.
Definition: Objsys.h:328
TEMU_API void temu_dictDispose(temu_Dict *Dict)
TEMU_API int temu_isString(temu_Propval Pv)
TEMU_API int temu_addArrayPseudoProperty(temu_Class *Cls, const char *Name, temu_Type T, int NumElems, const char *Doc)
TEMU_API void temu_listAppend(temu_List *List, temu_Propval Val)
TEMU_API const char * temu_dictGetNextKey(temu_Dict *Dict, const char *Key)
TEMU_API void temu_addInterfaceArray(temu_Class *Cls, const char *IfaceName, const char *IfaceType, void *Iface, size_t Count, size_t Size, const char *Doc)
TEMU_API double temu_readValueDouble(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API void * temu_getInterface(temu_Object_ *Obj, const char *IfaceName, int Idx)
TEMU_API temu_Component ** temu_getComponents(void)
Definition: Objsys.h:368
TEMU_API int8_t temu_getValueI8(temu_Object_ *Obj, const char *PropName, int Idx)
Pointer sized unsigned integer (uintptr_t)
Definition: Objsys.h:287
TEMU_API temu_Propval temu_checkpointGetValue(void *Ctxt, const char *Name, int Idx)
TEMU_API uint32_t temu_readValueU32(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API void temu_foreachProcessor(void(*Func)(temu_Object_ *, void *), void *Arg)
temu_ObjectS_ * TimeSource
Timesource object.
Definition: Objsys.h:85
TEMU_API int temu_addLoggingCategory(temu_Class *Cls, unsigned CategoryId, const char *Category)
TEMU_API temu_PropName temu_getPropName(const temu_Object_ *Obj, const char *PropName)
int64_t i64
Definition: Objsys.h:385
TEMU_API int temu_isDiscrete(temu_Propval Pv)
struct temu_IfaceRef temu_IfaceRef
uintptr_t Offset
Offset from struct start.
Definition: Objsys.h:1797
#define temu_ObjectS_
Definition: Temu2Compat.h:14
temu_Propval Val
Value of argument.
Definition: Objsys.h:413
TEMU_API size_t temu_getProcessorCount(void)
TEMU_API uint64_t temu_readValueUnsigned(temu_Object_ *Obj, const char *PropName, int Idx)
temu_Type Typ
Value type.
Definition: Objsys.h:369
TEMU_API void temu_ifaceRefArrayPush(temu_IfaceRefArray *Arr TEMU_NONNULL, temu_IfaceRef Iface)
TEMU_API void temu_setValueU8(temu_Object_ *Obj, const char *PropName, uint8_t Val, int Idx)
TEMU_API temu_Propval temu_listRemoveHead(temu_List *List)
TEMU_API int64_t temu_asInteger(temu_Propval Pv)
TEMU_API void temu_pluginPathAppend(const char *Path)
temu_Class * Class
Class pointer.
Definition: Objsys.h:83
Definition: Objsys.h:411
Definition: Objsys.h:345
Pointer sized signed integer (intptr_t)
Definition: Objsys.h:286
TEMU_API temu_Propval temu_snapshotGetValue(void *Ctxt, const char *Name, int Idx)
TEMU_API void temu_writeValueSigned(temu_Object_ *Obj, const char *PropName, int64_t Val, int Idx)
TEMU_API void temu_pluginPathPrint(void)
uint32_t Reserved
Number of slots allocated for array.
Definition: Objsys.h:127
uintptr_t UIntPtr
Definition: Objsys.h:372
temu_Dict * Dict
Definition: Objsys.h:392
Definition: Objsys.h:2133
TEMU_API temu_Class * temu_registerClass(const char *ClsName, temu_ObjectCreateFunc Create, temu_ObjectDisposeFunc Dispose)
temu_Object_ * Obj
Object pointer (first field of interface reference)
Definition: Objsys.h:112
TEMU_API int temu_isNumber(temu_Propval Pv)
TEMU_API temu_ListNode * temu_listGetHead(temu_List *List)
temu_Component * Component
Parent component (null for root comp)
Definition: Objsys.h:86
TEMU_API void temu_setValueU16(temu_Object_ *Obj, const char *PropName, uint16_t Val, int Idx)
Vector (i.e. dynamic array)
Definition: Objsys.h:317
TEMU_API temu_IfaceRefArray temu_ifaceRefArrayAlloc(unsigned Reserve)
void * VecData
Managed pointer, do not use directly.
Definition: Objsys.h:347
TEMU_API void temu_writeValueI64(temu_Object_ *Obj, const char *PropName, int64_t Val, int Idx)
temu_ListNode * Head
Managed pointer, do not use directly.
Definition: Objsys.h:357
TEMU_API void temu_serialiseProp(void *Ctxt, const char *Name, temu_Type Typ, int Count, void *Data)
TEMU_API temu_ListNode * temu_listGetNext(temu_ListNode *Node)
void temu_TypeObject
Definition: Objsys.h:1791
TEMU_API void temu_writeValueI8(temu_Object_ *Obj, const char *PropName, int8_t Val, int Idx)
TEMU_API const char * temu_nameForClass(temu_Class *Cls)
TEMU_API void temu_addInterfaceReference(temu_Class *Cls, const char *PropName, int Offset, const char *TypeName, int Count, unsigned Flags, temu_PropWriter Wr, temu_PropReader Rd, const char *Doc)
TEMU_API uint32_t temu_getValueU32(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API void temu_setTimeSource(temu_Object_ *Obj, temu_Object_ *TS)
TEMU_API int temu_addArrayProperty(temu_Class *Cls, const char *Name, int offset, temu_Type T, int NumElems, const char *Doc)
temu_Buff Buffer
Definition: Objsys.h:391
TEMU_API void * temu_registerInterfaceType(const char *Name)
void(* temu_ObjectDisposeFunc)(void *)
Definition: Objsys.h:423
TEMU_API uint16_t temu_getValueU16(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API double temu_asDouble(temu_Propval Pv)
TEMU_API void temu_ifaceRefArrayDispose(temu_IfaceRefArray *Arr)
TEMU_API void temu_ifaceRefArrayPush2(temu_IfaceRefArray *Arr TEMU_NONNULL, temu_Object_ *Obj TEMU_NONNULL, void *Iface TEMU_NONNULL)
Buffer (see Buffer.h)
Definition: Objsys.h:315
TEMU_API void temu_setValueI16(temu_Object_ *Obj, const char *PropName, int16_t Val, int Idx)
TEMU_API int temu_isPseudoProperty(temu_Object_ *Obj, const char *PropName)
Definition: Objsys.h:111
TEMU_API int64_t temu_getValueI64(temu_Object_ *Obj, const char *PropName, int Idx)
temu_ObjectCreateFunc Create
Constructor / create function for creating instances of the class.
Definition: Objsys.h:439
TEMU_API int temu_generateObjectGraph(const char *Path, int Display)
TEMU_API int temu_addScalarPseudoProperty(temu_Class *Cls, const char *Name, temu_Type T, const char *Doc)
temu_List List
Definition: Objsys.h:394
void * VTable
Internal pointer, do not touch.
Definition: Objsys.h:438
TEMU_API void temu_foreachInterface(temu_Class *C, void(*Func)(temu_Class *, const char *, void *), void *Arg)
TEMU_API int32_t temu_getValueI32(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API int temu_connect(temu_Object_ *A, const char *PropName, temu_Object_ *B, const char *IfaceName)
Dynamic object/interface array.
Definition: Objsys.h:312
64-bit fixed width signed integer
Definition: Objsys.h:301
Definition: Buffer.h:83