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" void temu_pluginInit(void)
25 #else
26 #define TEMU_PLUGIN_INIT 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 
332 typedef struct {
334  const char *Name;
335 } temu_PropName;
336 
337 typedef void temu_Dict;
338 
339 typedef struct {
341  void *VecData; // Managed pointer, do not use directly
342 } temu_Vector;
343 
344 typedef void temu_ListNode;
345 
346 typedef struct {
348  temu_ListNode *Head; // Managed pointer, do not use directly
349  temu_ListNode *Tail; // Managed pointer, do not use directly
350 } temu_List;
351 
359 typedef struct temu_Propval {
361  union {
362  intptr_t IntPtr;
363  uintptr_t UIntPtr;
364 
365  float f;
366  double d;
367 
368  uint8_t u8;
369  uint16_t u16;
370  uint32_t u32;
371  uint64_t u64;
372 
373  int8_t i8;
374  int16_t i16;
375  int32_t i32;
376  int64_t i64;
377 
381  const char *String;
386  };
387 } temu_Propval;
388 
402 typedef struct temu_CreateArg {
403  const char *Key;
406 
407 #define TEMU_NULL_ARG \
408  { \
409  NULL, { teTY_Invalid } \
410  }
411 
412 typedef void *(*temu_ObjectCreateFunc)(const char *Name, int Argc,
413  const temu_CreateArg *Argv);
414 typedef void (*temu_ObjectDisposeFunc)(void *);
415 
426 struct temu_Class {
428  void *Impl;
429  void *VTable;
432  const char *LoggingCategories[32]; // Named logging categories.
433 };
434 
435 // Dictionary support. Dictionaries are data structure that contain
436 // named prop values. They are not meant for high performing code, but
437 // are useful for advanced configuration capabilities. In practice
438 // dictionaries work for any type, but snapshots will not yet work
439 // for entries containing complex types (temu_Buff, temu_Vector and
440 // other dictionaries). This will be addressed in the future.
441 
447 
454 
464 TEMU_API int temu_dictInsertValue(temu_Dict *Dict, const char *Name,
465  temu_Propval Val);
466 
474 TEMU_API temu_Propval temu_dictGetValue(temu_Dict *Dict, const char *Name);
475 
484 TEMU_API int temu_dictRemoveValue(temu_Dict *Dict, const char *Name);
485 
494 TEMU_API const char *temu_dictGetNextKey(temu_Dict *Dict, const char *Key);
495 
496 // Typed vector support. The typed vectors can be described as a C++
497 // std::vector, however, they are expressed as a C-API here and
498 // supports snapshots.
506 
513 
521 
529 
537 
545 
552 
560 
568 
576 
584 
592 
600 
608 
616 
624 
625 #ifdef PROP_ASSERTS_ENABLED
626 #define PROP_ASSERT(p, t) assert(p.Typ == t && "invalid property type")
627 #else
628 #define PROP_ASSERT(p, t)
629 #endif
630 
631 // Ugly, but we want to be compatible with C++ and C99, meaning:
632 // cannot use designated initializers (C99, not C++)
633 // cannot use constructors (C++, not C99)
634 
635 #define PROP_VAL_INITIALIZER(typ, suffix, typetag, valtag) \
636  static inline temu_Propval temu_makeProp##suffix(typ val) \
637  { \
638  temu_Propval pv; \
639  pv.Typ = typetag; \
640  pv.valtag = val; \
641  return pv; \
642  } \
643  static inline typ temu_propValue##suffix(temu_Propval pv) \
644  { \
645  PROP_ASSERT(pv.Typ, typetag); \
646  typ val = pv.valtag; \
647  return val; \
648  }
649 
650 PROP_VAL_INITIALIZER(intptr_t, IntPtr, teTY_Intptr, IntPtr)
651 PROP_VAL_INITIALIZER(uintptr_t, UIntPtr, teTY_Uintptr, UIntPtr)
652 
653 PROP_VAL_INITIALIZER(float, Float, teTY_Float, f)
654 PROP_VAL_INITIALIZER(double, Double, teTY_Double, d)
655 
656 PROP_VAL_INITIALIZER(uint8_t, U8, teTY_U8, u8)
657 PROP_VAL_INITIALIZER(uint16_t, U16, teTY_U16, u16)
658 PROP_VAL_INITIALIZER(uint32_t, U32, teTY_U32, u32)
659 PROP_VAL_INITIALIZER(uint64_t, U64, teTY_U64, u64)
660 
661 PROP_VAL_INITIALIZER(int8_t, I8, teTY_I8, i8)
662 PROP_VAL_INITIALIZER(int16_t, I16, teTY_I16, i16)
663 PROP_VAL_INITIALIZER(int32_t, I32, teTY_I32, i32)
664 PROP_VAL_INITIALIZER(int64_t, I64, teTY_I64, i64)
665 
668 PROP_VAL_INITIALIZER(const char *, String, teTY_String, String)
669 
670 
676 typedef void (*temu_PropWriter)(void *Obj, temu_Propval Pv, int Idx);
677 
684 typedef temu_Propval (*temu_PropReader)(void *Obj, int Idx);
685 
696  const char *PropName);
697 
709  const char *PropName);
710 
718 TEMU_API int temu_getPropLength(const temu_Object_ *Obj, const char *PropName);
719 
728  const char *PropName);
729 
738  const char *PropName);
739 
748 TEMU_API int temu_objectHasProp(const temu_Object_ *Obj, const char *PropName);
749 
760  const char *IfaceName);
761 
769 
777 
785 
788 
796 
804 
812 
820 
829 TEMU_API temu_Propval temu_getValue(temu_Object_ *Obj, const char *PropName,
830  int Idx) TEMU_NO_WRAP;
831 
840 TEMU_API uint8_t temu_getValueU8(temu_Object_ *Obj, const char *PropName,
841  int Idx);
842 
852 TEMU_API uint16_t temu_getValueU16(temu_Object_ *Obj, const char *PropName,
853  int Idx);
854 
864 TEMU_API uint32_t temu_getValueU32(temu_Object_ *Obj, const char *PropName,
865  int Idx);
866 
876 TEMU_API uint64_t temu_getValueU64(temu_Object_ *Obj, const char *PropName,
877  int Idx);
878 
887 TEMU_API int8_t temu_getValueI8(temu_Object_ *Obj, const char *PropName,
888  int Idx);
889 
898 TEMU_API int16_t temu_getValueI16(temu_Object_ *Obj, const char *PropName,
899  int Idx);
900 
909 TEMU_API int32_t temu_getValueI32(temu_Object_ *Obj, const char *PropName,
910  int Idx);
911 
920 TEMU_API int64_t temu_getValueI64(temu_Object_ *Obj, const char *PropName,
921  int Idx);
922 
933 TEMU_API temu_Propval temu_readValue(temu_Object_ *Obj, const char *PropName,
934  int Idx) TEMU_NO_WRAP;
935 
949 TEMU_API uint8_t temu_readValueU8(temu_Object_ *Obj, const char *PropName,
950  int Idx);
951 
965 TEMU_API uint16_t temu_readValueU16(temu_Object_ *Obj, const char *PropName,
966  int Idx);
967 
981 TEMU_API uint32_t temu_readValueU32(temu_Object_ *Obj, const char *PropName,
982  int Idx);
983 
997 TEMU_API uint64_t temu_readValueU64(temu_Object_ *Obj, const char *PropName,
998  int Idx);
999 
1013 TEMU_API int8_t temu_readValueI8(temu_Object_ *Obj, const char *PropName,
1014  int Idx);
1015 
1029 TEMU_API int16_t temu_readValueI16(temu_Object_ *Obj, const char *PropName,
1030  int Idx);
1031 
1045 TEMU_API int32_t temu_readValueI32(temu_Object_ *Obj, const char *PropName,
1046  int Idx);
1047 
1061 TEMU_API int64_t temu_readValueI64(temu_Object_ *Obj, const char *PropName,
1062  int Idx);
1063 
1072 TEMU_API void temu_setValue(temu_Object_ *Obj, const char *PropName,
1073  temu_Propval Val, int Idx) TEMU_NO_WRAP;
1074 
1083 TEMU_API void temu_setValueU8(temu_Object_ *Obj, const char *PropName,
1084  uint8_t Val, int Idx);
1085 
1094 TEMU_API void temu_setValueU16(temu_Object_ *Obj, const char *PropName,
1095  uint16_t Val, int Idx);
1096 
1105 TEMU_API void temu_setValueU32(temu_Object_ *Obj, const char *PropName,
1106  uint32_t Val, int Idx);
1107 
1116 TEMU_API void temu_setValueU64(temu_Object_ *Obj, const char *PropName,
1117  uint64_t Val, int Idx);
1118 
1127 TEMU_API void temu_setValueI8(temu_Object_ *Obj, const char *PropName,
1128  int8_t Val, int Idx);
1129 
1138 TEMU_API void temu_setValueI16(temu_Object_ *Obj, const char *PropName,
1139  int16_t Val, int Idx);
1140 
1149 TEMU_API void temu_setValueI32(temu_Object_ *Obj, const char *PropName,
1150  int32_t Val, int Idx);
1151 
1160 TEMU_API void temu_setValueI64(temu_Object_ *Obj, const char *PropName,
1161  int64_t Val, int Idx);
1162 
1171 TEMU_API void temu_writeValue(temu_Object_ *Obj, const char *PropName,
1172  temu_Propval Val, int Idx) TEMU_NO_WRAP;
1173 
1182 TEMU_API void temu_writeValueU8(temu_Object_ *Obj, const char *PropName,
1183  uint8_t Val, int Idx);
1184 
1193 TEMU_API void temu_writeValueU16(temu_Object_ *Obj, const char *PropName,
1194  uint16_t Val, int Idx);
1195 
1204 TEMU_API void temu_writeValueU32(temu_Object_ *Obj, const char *PropName,
1205  uint32_t Val, int Idx);
1206 
1215 TEMU_API void temu_writeValueU64(temu_Object_ *Obj, const char *PropName,
1216  uint64_t Val, int Idx);
1217 
1226 TEMU_API void temu_writeValueI8(temu_Object_ *Obj, const char *PropName,
1227  int8_t Val, int Idx);
1228 
1237 TEMU_API void temu_writeValueI16(temu_Object_ *Obj, const char *PropName,
1238  int16_t Val, int Idx);
1239 
1248 TEMU_API void temu_writeValueI32(temu_Object_ *Obj, const char *PropName,
1249  int32_t Val, int Idx);
1250 
1259 TEMU_API void temu_writeValueI64(temu_Object_ *Obj, const char *PropName,
1260  int64_t Val, int Idx);
1261 
1274 TEMU_API temu_Class *temu_registerClass(const char *ClsName,
1275  temu_ObjectCreateFunc Create,
1276  temu_ObjectDisposeFunc Dispose);
1277 
1278 #ifdef __cplusplus
1279 
1298 TEMU_API void temu_addProperty(temu_Class *Cls, const char *PropName,
1299  int Offset, temu_Type Typ, int Count,
1300  temu_PropWriter Wr = nullptr,
1301  temu_PropReader Rd = nullptr,
1302  const char *Doc = "");
1303 #else
1304 
1323 TEMU_API void temu_addProperty(temu_Class *Cls, const char *PropName,
1324  int Offset, temu_Type Typ, int Count,
1326  const char *Doc);
1327 
1328 #endif
1329 
1357 TEMU_API void temu_addPseudoProperty(temu_Class *Cls, const char *PropName,
1358  temu_Type Typ, int Count,
1361  const char *Doc);
1362 
1371 TEMU_API int temu_addLoggingCategory(temu_Class *Cls, unsigned CategoryId,
1372  const char *Category);
1373 
1382  unsigned CategoryId);
1383 
1391 TEMU_API int temu_isPseudoProperty(temu_Object_ *Obj, const char *PropName);
1392 
1401 TEMU_API int temu_isNormalProperty(temu_Object_ *Obj, const char *PropName);
1402 
1414 TEMU_API void temu_requireInterface(temu_Class *Cls, const char *PropName,
1415  const char *IfaceType);
1416 
1435 TEMU_API void temu_addInterfaceReference(temu_Class *Cls, const char *PropName,
1436  int Offset, const char *TypeName,
1437  int Count, unsigned Flags,
1439  const char *Doc);
1440 
1441 
1459 TEMU_API void temu_addPseudoInterfaceReference(temu_Class *Cls, const char *PropName,
1460  const char *TypeName, int Count, unsigned Flags,
1463  const char *Doc);
1464 
1483 TEMU_API int temu_addPort(temu_Class *C, const char *IfaceRefName,
1484  const char *IfaceName, const char *Doc);
1485 
1494 #ifdef __cplusplus
1495 
1508 TEMU_API void temu_addInterface(temu_Class *Cls, const char *IfaceName,
1509  const char *IfaceType, void *Iface,
1510  int DeprecatedParam = 0, const char *Doc = "");
1511 
1521 TEMU_API void *temu_getInterface(temu_Object_ *Obj, const char *IfaceName,
1522  int Idx = 0);
1523 
1524 #else
1526 
1527  const char *IfaceName, const char *IfaceType,
1528  void *Iface, int DeprecatedParam,
1529  const char *Doc);
1530 
1531 TEMU_API void *temu_getInterface(temu_Object_ *Obj, const char *IfaceName,
1532  int Idx);
1533 
1534 #endif
1535 
1546  const char *IfaceName, int Idx);
1547 
1555 TEMU_API const char *temu_getInterfaceName(temu_Object *Obj, void *Iface);
1556 
1575 TEMU_API void temu_addInterfaceArray(temu_Class *Cls, const char *IfaceName,
1576  const char *IfaceType, void *Iface,
1577  size_t Count, size_t Size,
1578  const char *Doc);
1579 
1593 TEMU_API int temu_setVTable(temu_Class *Cls, void *VTable);
1594 
1602 
1610 TEMU_API void *temu_getVTable(const temu_Object_ *Obj);
1611 
1620 
1621 /*
1622  * Qualification support
1623  *
1624  * Qualifiers can set a tag per class, which can then be used for
1625  * quick identification of an object's class properties. For example
1626  * all objects qualified as CPUs, machines and memories must have the
1627  * vtable set appropriatelly.
1628  */
1629 #define TEMU_QUAL_NONE 0
1630 #define TEMU_QUAL_CPU 1
1631 #define TEMU_QUAL_MACHINE 2
1632 #define TEMU_QUAL_MEMORY 4
1633 #define TEMU_QUAL_COMPONENT 5
1634 #define TEMU_QUAL_CLOCK 6
1635 
1636 // Users can set their own class qualifiers, but should use an offset
1637 // from the TEMU_QUAL_USER.
1638 #define TEMU_QUAL_USER 65536
1639 
1647 TEMU_API int temu_isQualifiedAs(const temu_Object_ *Obj, unsigned Qualifier);
1648 
1656 TEMU_API int temu_isCpu(const temu_Object_ *Obj);
1657 
1665 TEMU_API int temu_isMachine(const temu_Object_ *Obj);
1666 
1673 TEMU_API int temu_isMemory(const temu_Object_ *Obj);
1674 
1681 TEMU_API int temu_isComponent(const temu_Object_ *Obj);
1682 
1691 
1700 
1707 
1714 TEMU_API void temu_qualifyAs(temu_Class *Cls, unsigned Qualifier);
1715 
1719 TEMU_API void temu_objsysClear(void);
1720 
1724 
1738 TEMU_API temu_Object_ *temu_createObject(const char *ClsName,
1739  const char *ObjName,
1740  const temu_CreateArg *Args);
1741 
1748 
1755 TEMU_API temu_Class *temu_classForName(const char *ClsName);
1756 
1763 TEMU_API const char *temu_nameForClass(temu_Class *Cls);
1764 
1772 
1780 TEMU_API int temu_classHasCommand(const temu_Class *Cls, const char *CmdName);
1781 
1782 typedef void temu_TypeObject;
1783 
1784 typedef struct {
1785  const char *Name;
1787  size_t Count;
1788  uintptr_t Offset;
1790 } temu_PropInfo;
1791 
1819 TEMU_API int temu_propInfoForClass(temu_Class *Cls, unsigned PIIndex,
1820  unsigned PICount, temu_PropInfo *PI);
1821 
1828 TEMU_API temu_Object_ *temu_objectForName(const char *Name);
1829 
1836 TEMU_API const char *temu_nameForObject(const temu_Object_ *Obj);
1837 
1845 TEMU_API const char *temu_nameForInterface(const temu_Object_ *Obj,
1846  const void *Iface);
1847 
1857 TEMU_API int temu_indexForInterface(const temu_Object_ *Obj, const void *Iface);
1858 
1866 TEMU_API const char *temu_typenameForInterface(const temu_Object_ *Obj,
1867  const void *Iface);
1868 
1889 TEMU_API int temu_loadPlugin(const char *PluginName);
1890 
1897 TEMU_API void temu_pluginPathAppend(const char *Path);
1898 
1905 TEMU_API void temu_pluginPathRemove(const char *Path);
1906 
1911 TEMU_API void temu_pluginPathPrint(void);
1912 
1919 TEMU_API const char *temu_typeToName(temu_Type Typ);
1920 
1921 /* NOTE: The getProcessors, getProcsessorCount, getComponents and
1922  getComponentCount functions are experimental and unstable. Do not
1923  rely on these for the moment.
1924 */
1932 
1938 TEMU_API size_t temu_getProcessorCount(void);
1939 
1947 
1953 TEMU_API size_t temu_getComponentCount(void);
1954 
1969 TEMU_API int temu_connect(temu_Object_ *A, const char *PropName,
1970  temu_Object_ *B, const char *IfaceName);
1971 
1986 TEMU_API int temu_serialiseJSON(const char *FileName);
1987 
2000 TEMU_API int temu_deserialiseJSON(const char *FileName);
2001 
2015 TEMU_API int temu_inlineDeserialiseJSON(const char *FileName);
2016 
2017 
2032 TEMU_API void temu_serialiseProp(void *Ctxt, const char *Name, temu_Type Typ,
2033  int Count, void *Data);
2034 
2044 TEMU_API void temu_deserialiseProp(void *Ctxt, temu_Object_ *Obj,
2045  const char *Name);
2046 
2054 TEMU_API int temu_snapshotGetLength(void *Ctxt, const char *Name);
2062 TEMU_API int temu_checkpointGetLength(void *Ctxt, const char *Name);
2063 
2072 TEMU_API temu_Propval temu_snapshotGetValue(void *Ctxt, const char *Name,
2073  int Idx);
2074 
2083 TEMU_API temu_Propval temu_checkpointGetValue(void *Ctxt, const char *Name,
2084  int Idx);
2085 
2098 TEMU_API int temu_checkSanity(int Report);
2099 
2113 TEMU_API int temu_generateObjectGraph(const char *Path, int Display);
2114 
2115 TEMU_API int temu_isValidObjectName(const char *Name);
2116 TEMU_API int temu_isValidClassName(const char *Name);
2117 TEMU_API int temu_isValidInterfaceName(const char *Name);
2118 TEMU_API int temu_isValidPropertyName(const char *Name);
2119 
2124 typedef struct {
2133  void (*serialise)(void *Obj, const char *BaseName, void *Ctxt);
2134 
2144  void (*deserialise)(void *Obj, const char *BaseName, void *Ctxt);
2145 
2152  int (*checkSanity)(void *Obj, int Report); // Optional
2153 
2160  void (*timeSourceSet)(void *Obj);
2161 
2168  void (*printObject)(void *Obj);
2170 #define TEMU_OBJECT_IFACE_TYPE "ObjectIface"
2172 
2173 
2181 TEMU_API void temu_foreachObject(void (*Func)(temu_Object_ *, void *),
2182  void *Arg);
2183 
2192 TEMU_API void temu_foreachClass(void (*Func)(temu_Class *, void *), void *Arg);
2193 
2202 TEMU_API void temu_foreachProcessor(void (*Func)(temu_Object_ *, void *),
2203  void *Arg);
2204 
2216  temu_Class *C, void (*Func)(temu_Class *, const char *, void *), void *Arg);
2217 
2229  temu_Class *C, void (*Func)(temu_Class *, const char *, void *), void *Arg);
2230 
2231 TEMU_API void *temu_registerInterfaceType(const char *Name);
2232 TEMU_API void *temu_getInterfaceType(const char *Name);
2233 // TEMU_API void temu_ifaceTypeAddFunc(void *T, const char *Name, temu_MetaType
2234 // *RetTy,
2235 // ...);
2236 
2237 TEMU_API int temu_addScalarProperty(temu_Class *Cls, const char *Name,
2238  int offset, temu_Type T,
2239  const char *Doc); // Done
2240 
2241 TEMU_API int temu_addArrayProperty(temu_Class *Cls, const char *Name,
2242  int offset, temu_Type T, int NumElems,
2243  const char *Doc); // Done
2244 
2245 TEMU_API int temu_addScalarPseudoProperty(temu_Class *Cls, const char *Name,
2246  temu_Type T, const char *Doc); // Done
2247 
2248 TEMU_API int temu_addArrayPseudoProperty(temu_Class *Cls, const char *Name,
2249  temu_Type T, int NumElems,
2250  const char *Doc); // Done
2251 
2252 TEMU_API temu_Object_ *temu_createObject(const char *ClsName,
2253  const char *ObjName,
2254  const temu_CreateArg *Args); // Done
2255 TEMU_API void temu_disposeObject(temu_Object_ *Obj); // Done
2256 
2257 TEMU_API int temu_writeProp(temu_Object_ *Obj, const char *Name, int idx,
2258  temu_Propval *PV); // Done
2259 
2260 TEMU_API temu_Propval temu_readProp(temu_Object_ *Obj, const char *Name,
2261  int idx); // Done
2262 
2264  const char *PropName); // Done
2265 
2267  const char *PropName); // Done
2268 
2270  const char *PropName); // Done
2271 
2273  const char *PropName); // Done
2274 
2276  const char *PropName); // Done
2277 
2279  const char *PropName); // Done
2280 
2282  const char *IfaceName); // Done
2283 
2284 TEMU_API uint64_t temu_getValueUnsigned(temu_Object_ *Obj, const char *PropName,
2285  int Idx); // Done
2286 TEMU_API int64_t temu_getValueSigned(temu_Object_ *Obj, const char *PropName,
2287  int Idx); // Done
2288 
2289 TEMU_API double temu_getValueDouble(temu_Object_ *Obj, const char *PropName,
2290  int Idx); // Done
2291 
2293  const char *PropName,
2294  int Idx); // Done
2295 TEMU_API int64_t temu_readValueSigned(temu_Object_ *Obj, const char *PropName,
2296  int Idx); // Done
2297 TEMU_API double temu_readValueDouble(temu_Object_ *Obj, const char *PropName,
2298  int Idx); // Done
2299 
2300 TEMU_API void temu_setValueUnsigned(temu_Object_ *Obj, const char *PropName,
2301  uint64_t Val, int Idx); // Done
2302 TEMU_API void temu_setValueSigned(temu_Object_ *Obj, const char *PropName,
2303  int64_t Val,
2304  int Idx); // Done
2305 TEMU_API void temu_setValueDouble(temu_Object_ *Obj, const char *PropName,
2306  double Val,
2307  int Idx); // Done
2308 
2309 TEMU_API void temu_writeValueUnsigned(temu_Object_ *Obj, const char *PropName,
2310  uint64_t Val, int Idx); // Done
2311 TEMU_API void temu_writeValueSigned(temu_Object_ *Obj, const char *PropName,
2312  int64_t Val,
2313  int Idx); // Done
2314 TEMU_API void temu_writeValueDouble(temu_Object_ *Obj, const char *PropName,
2315  double Val,
2316  int Idx); // Done
2317 
2318 TEMU_API int temu_addLoggingCategory(temu_Class *Cls, unsigned CategoryId,
2319  const char *Category);
2320 
2322  unsigned CategoryId);
2323 
2324 TEMU_API void temu_requireInterface(temu_Class *Cls, const char *PropName,
2325  const char *IfaceType); // Done
2326 
2327 TEMU_API int temu_addPort(temu_Class *C, const char *IfaceRefName,
2328  const char *IfaceName, const char *Doc); // Done
2329 
2330 // Deprecated param: what to do?
2331 TEMU_API void temu_addInterface(temu_Class *Cls, const char *IfaceName,
2332  const char *IfaceType, void *Iface,
2333  int DeprecatedParam,
2334  const char *Doc); // Done
2335 
2336 TEMU_API void *temu_getInterface(temu_Object_ *Obj, const char *IfaceName,
2337  int Idx); // Done
2338 
2340  const char *IfaceName,
2341  int Idx); // Done
2342 
2343 TEMU_API int temu_setVTable(temu_Class *Cls, void *VTable); // Implemented
2344 TEMU_API void *temu_getVTableForClass(temu_Class *Cls); // Implemented
2345 TEMU_API void *temu_getVTable(const temu_Object_ *Obj); // Implemented
2346 
2347 TEMU_API temu_Object_ *temu_createObject(const char *ClsName,
2348  const char *ObjName,
2349  const temu_CreateArg *Args); // Done
2350 
2351 TEMU_API void temu_disposeObject(temu_Object_ *Obj); // Done
2352 
2354  const char *CmdName); // Done
2355 
2356 TEMU_API int temu_propInfoForClass(temu_Class *Cls, unsigned PIIndex,
2357  unsigned PICount, temu_PropInfo *PI);
2358 
2359 TEMU_API temu_Propval temu_signedPropval(temu_Type T, int64_t I); // Done
2360 TEMU_API temu_Propval temu_unsignedPropval(temu_Type T, uint64_t U); // Done
2362 
2363 TEMU_API int temu_objectHasCmd(const temu_Object_ *Obj, const char *CmdName);
2364 
2365 #ifdef __cplusplus
2366 }
2367 #endif
2368 
2369 #endif
temu_ObjectDisposeFunc Dispose
Destructor / dispose function for disposing instances of the class.
Definition: Objsys.h:431
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:373
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
Definition: Objsys.h:340
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:676
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:1784
Single precision floating point value.
Definition: Objsys.h:290
const char * String
Definition: Objsys.h:381
#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
Definition: Objsys.h:347
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
Definition: Objsys.h:349
Definition: Objsys.h:332
#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:1786
TEMU_API void temu_vecPush(temu_Vector *Vec, temu_Propval Val)
uint16_t u16
Definition: Objsys.h:369
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:371
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
Definition: Objsys.h:334
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_getInterface(temu_Object_ *Obj, const char *IfaceName, 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:374
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:403
TEMU_API int temu_snapshotGetLength(void *Ctxt, const char *Name)
intptr_t IntPtr
Definition: Objsys.h:362
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:379
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:375
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:412
temu_Object_ * Obj
Definition: Objsys.h:378
TEMU_API void * temu_getInterfaceType(const char *Name)
void * Impl
Internal pointer, do not touch.
Definition: Objsys.h:428
uint8_t u8
Definition: Objsys.h:368
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
Definition: Objsys.h:126
temu_Propval(* temu_PropReader)(void *Obj, int Idx)
Definition: Objsys.h:684
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 void * temu_getVTable(const temu_Object_ *Obj)
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:384
struct temu_Component temu_Component
Definition: Component.h:27
double d
Definition: Objsys.h:366
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:337
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:365
#define PROP_VAL_INITIALIZER(typ, suffix, typetag, valtag)
Definition: Objsys.h:635
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:426
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 const char * temu_nameForInterface(const temu_Object_ *Obj, const void *Iface)
TEMU_API void temu_objsysClear(void)
temu_Object_ * Obj
Definition: Objsys.h:333
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:432
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 uint16_t temu_readValueU16(temu_Object_ *Obj, const char *PropName, int Idx)
TEMU_API temu_Object_ * temu_objectForName(const char *Name)
void * Ptr
Definition: Objsys.h:329
TEMU_API temu_Vector temu_vecCreate(temu_Type Typ)
temu_IfaceRefArray IfaceRefArray
Definition: Objsys.h:380
Double precision floating point value.
Definition: Objsys.h:291
TEMU_API void * temu_vecGetData(temu_Vector *Vec)
TEMU_API const char * temu_getLoggingCategory(temu_Class *Cls, unsigned CategoryId)
TEMU_API void * temu_getVTableForClass(temu_Class *Cls)
TEMU_API int temu_isValidClassName(const char *Name)
size_t Count
Number of elements in property.
Definition: Objsys.h:1787
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:1789
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
Definition: Objsys.h:128
Definition: Objsys.h:346
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)
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:427
uint32_t u32
Definition: Objsys.h:370
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 temu_Object_ * temu_createObject(const char *ClsName, const char *ObjName, const temu_CreateArg *Args)
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:344
TEMU_API int temu_isMachine(const temu_Object_ *Obj)
const char * Name
Name of property.
Definition: Objsys.h:1785
temu_Type Typ
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 temu_Component ** temu_getComponents(void)
Definition: Objsys.h:359
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:376
TEMU_API int temu_isDiscrete(temu_Propval Pv)
struct temu_IfaceRef temu_IfaceRef
uintptr_t Offset
Offset from struct start.
Definition: Objsys.h:1788
#define temu_ObjectS_
Definition: Temu2Compat.h:14
temu_Propval Val
Value of argument.
Definition: Objsys.h:404
TEMU_API size_t temu_getProcessorCount(void)
TEMU_API uint64_t temu_readValueUnsigned(temu_Object_ *Obj, const char *PropName, int Idx)
temu_Type Typ
Definition: Objsys.h:360
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:402
Definition: Objsys.h:339
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
Definition: Objsys.h:127
uintptr_t UIntPtr
Definition: Objsys.h:363
temu_Dict * Dict
Definition: Objsys.h:383
Definition: Objsys.h:2124
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
Definition: Objsys.h:341
TEMU_API void temu_writeValueI64(temu_Object_ *Obj, const char *PropName, int64_t Val, int Idx)
temu_ListNode * Head
Definition: Objsys.h:348
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:1782
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:382
TEMU_API void * temu_registerInterfaceType(const char *Name)
void(* temu_ObjectDisposeFunc)(void *)
Definition: Objsys.h:414
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:430
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:385
void * VTable
Internal pointer, do not touch.
Definition: Objsys.h:429
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