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 
709 
727 typedef struct temu_PropAccessor {
730  int Index;
731 
732  void *Data;
737 
738  temu_Propval (*readProp)(struct temu_PropAccessor *accessor);
739  void (*writeProp)(struct temu_PropAccessor *accessor, temu_Propval pv);
740  temu_Propval (*getProp)(struct temu_PropAccessor *accessor);
741  void (*setProp)(struct temu_PropAccessor *accessor, temu_Propval pv);
743 
744 
745 
762 TEMU_API temu_PropAccessor temu_getPropAccessor(temu_Object *Obj, const char *PropName, int PropIdx);
763 
775  const char *PropName);
776 
784 TEMU_API int temu_getPropLength(const temu_Object_ *Obj, const char *PropName);
785 
798  const char *PropName);
799 
808  const char *PropName);
809 
817 TEMU_API int temu_objectHasProp(const temu_Object_ *Obj, const char *PropName);
818 
828  const char *IfaceName);
829 
837 
845 
853 
856 
864 
872 
880 
888 
897 TEMU_API temu_Propval temu_getValue(temu_Object_ *Obj, const char *PropName,
898  int Idx) TEMU_NO_WRAP;
899 
908 TEMU_API uint8_t temu_getValueU8(temu_Object_ *Obj, const char *PropName,
909  int Idx);
910 
919 TEMU_API uint16_t temu_getValueU16(temu_Object_ *Obj, const char *PropName,
920  int Idx);
921 
930 TEMU_API uint32_t temu_getValueU32(temu_Object_ *Obj, const char *PropName,
931  int Idx);
932 
941 TEMU_API uint64_t temu_getValueU64(temu_Object_ *Obj, const char *PropName,
942  int Idx);
943 
952 TEMU_API int8_t temu_getValueI8(temu_Object_ *Obj, const char *PropName,
953  int Idx);
954 
963 TEMU_API int16_t temu_getValueI16(temu_Object_ *Obj, const char *PropName,
964  int Idx);
965 
974 TEMU_API int32_t temu_getValueI32(temu_Object_ *Obj, const char *PropName,
975  int Idx);
976 
985 TEMU_API int64_t temu_getValueI64(temu_Object_ *Obj, const char *PropName,
986  int Idx);
987 
998 TEMU_API temu_Propval temu_readValue(temu_Object_ *Obj, const char *PropName,
999  int Idx) TEMU_NO_WRAP;
1000 
1014 TEMU_API uint8_t temu_readValueU8(temu_Object_ *Obj, const char *PropName,
1015  int Idx);
1016 
1030 TEMU_API uint16_t temu_readValueU16(temu_Object_ *Obj, const char *PropName,
1031  int Idx);
1032 
1046 TEMU_API uint32_t temu_readValueU32(temu_Object_ *Obj, const char *PropName,
1047  int Idx);
1048 
1062 TEMU_API uint64_t temu_readValueU64(temu_Object_ *Obj, const char *PropName,
1063  int Idx);
1064 
1078 TEMU_API int8_t temu_readValueI8(temu_Object_ *Obj, const char *PropName,
1079  int Idx);
1080 
1094 TEMU_API int16_t temu_readValueI16(temu_Object_ *Obj, const char *PropName,
1095  int Idx);
1096 
1110 TEMU_API int32_t temu_readValueI32(temu_Object_ *Obj, const char *PropName,
1111  int Idx);
1112 
1126 TEMU_API int64_t temu_readValueI64(temu_Object_ *Obj, const char *PropName,
1127  int Idx);
1128 
1137 TEMU_API void temu_setValue(temu_Object_ *Obj, const char *PropName,
1138  temu_Propval Val, int Idx) TEMU_NO_WRAP;
1139 
1148 TEMU_API void temu_setValueU8(temu_Object_ *Obj, const char *PropName,
1149  uint8_t Val, int Idx);
1150 
1159 TEMU_API void temu_setValueU16(temu_Object_ *Obj, const char *PropName,
1160  uint16_t Val, int Idx);
1161 
1170 TEMU_API void temu_setValueU32(temu_Object_ *Obj, const char *PropName,
1171  uint32_t Val, int Idx);
1172 
1181 TEMU_API void temu_setValueU64(temu_Object_ *Obj, const char *PropName,
1182  uint64_t Val, int Idx);
1183 
1192 TEMU_API void temu_setValueI8(temu_Object_ *Obj, const char *PropName,
1193  int8_t Val, int Idx);
1194 
1203 TEMU_API void temu_setValueI16(temu_Object_ *Obj, const char *PropName,
1204  int16_t Val, int Idx);
1205 
1214 TEMU_API void temu_setValueI32(temu_Object_ *Obj, const char *PropName,
1215  int32_t Val, int Idx);
1216 
1225 TEMU_API void temu_setValueI64(temu_Object_ *Obj, const char *PropName,
1226  int64_t Val, int Idx);
1227 
1236 TEMU_API void temu_writeValue(temu_Object_ *Obj, const char *PropName,
1237  temu_Propval Val, int Idx) TEMU_NO_WRAP;
1238 
1247 TEMU_API void temu_writeValueU8(temu_Object_ *Obj, const char *PropName,
1248  uint8_t Val, int Idx);
1249 
1258 TEMU_API void temu_writeValueU16(temu_Object_ *Obj, const char *PropName,
1259  uint16_t Val, int Idx);
1260 
1269 TEMU_API void temu_writeValueU32(temu_Object_ *Obj, const char *PropName,
1270  uint32_t Val, int Idx);
1271 
1280 TEMU_API void temu_writeValueU64(temu_Object_ *Obj, const char *PropName,
1281  uint64_t Val, int Idx);
1282 
1291 TEMU_API void temu_writeValueI8(temu_Object_ *Obj, const char *PropName,
1292  int8_t Val, int Idx);
1293 
1302 TEMU_API void temu_writeValueI16(temu_Object_ *Obj, const char *PropName,
1303  int16_t Val, int Idx);
1304 
1313 TEMU_API void temu_writeValueI32(temu_Object_ *Obj, const char *PropName,
1314  int32_t Val, int Idx);
1315 
1324 TEMU_API void temu_writeValueI64(temu_Object_ *Obj, const char *PropName,
1325  int64_t Val, int Idx);
1326 
1339 TEMU_API temu_Class *temu_registerClass(const char *ClsName,
1340  temu_ObjectCreateFunc Create,
1341  temu_ObjectDisposeFunc Dispose);
1342 
1343 #ifdef __cplusplus
1344 
1363 TEMU_API void temu_addProperty(temu_Class *Cls, const char *PropName,
1364  int Offset, temu_Type Typ, int Count,
1365  temu_PropWriter Wr = nullptr,
1366  temu_PropReader Rd = nullptr,
1367  const char *Doc = "");
1368 #else
1369 
1388 TEMU_API void temu_addProperty(temu_Class *Cls, const char *PropName,
1389  int Offset, temu_Type Typ, int Count,
1391  const char *Doc);
1392 
1393 #endif
1394 
1422 TEMU_API void temu_addPseudoProperty(temu_Class *Cls, const char *PropName,
1423  temu_Type Typ, int Count,
1426  const char *Doc);
1427 
1436 TEMU_API int temu_addLoggingCategory(temu_Class *Cls, unsigned CategoryId,
1437  const char *Category);
1438 
1447  unsigned CategoryId);
1448 
1456 TEMU_API int temu_isPseudoProperty(temu_Object_ *Obj, const char *PropName);
1457 
1466 TEMU_API int temu_isNormalProperty(temu_Object_ *Obj, const char *PropName);
1467 
1479 TEMU_API void temu_requireInterface(temu_Class *Cls, const char *PropName,
1480  const char *IfaceType);
1481 
1500 TEMU_API void temu_addInterfaceReference(temu_Class *Cls, const char *PropName,
1501  int Offset, const char *TypeName,
1502  int Count, unsigned Flags,
1504  const char *Doc);
1505 
1506 
1524 TEMU_API void temu_addPseudoInterfaceReference(temu_Class *Cls, const char *PropName,
1525  const char *TypeName, int Count, unsigned Flags,
1528  const char *Doc);
1529 
1548 TEMU_API int temu_addPort(temu_Class *C, const char *IfaceRefName,
1549  const char *IfaceName, const char *Doc);
1550 
1559 #ifdef __cplusplus
1560 
1573 TEMU_API void temu_addInterface(temu_Class *Cls, const char *IfaceName,
1574  const char *IfaceType, void *Iface,
1575  int DeprecatedParam = 0, const char *Doc = "");
1576 
1586 TEMU_API void *temu_getInterface(temu_Object_ *Obj, const char *IfaceName,
1587  int Idx = 0);
1588 
1589 #else
1591 
1592  const char *IfaceName, const char *IfaceType,
1593  void *Iface, int DeprecatedParam,
1594  const char *Doc);
1595 
1596 TEMU_API void *temu_getInterface(temu_Object_ *Obj, const char *IfaceName,
1597  int Idx);
1598 
1599 #endif
1600 
1610  const char *IfaceName, int Idx);
1611 
1619 TEMU_API const char *temu_getInterfaceName(temu_Object *Obj, void *Iface);
1620 
1639 TEMU_API void temu_addInterfaceArray(temu_Class *Cls, const char *IfaceName,
1640  const char *IfaceType, void *Iface,
1641  size_t Count, size_t Size,
1642  const char *Doc);
1643 
1657 TEMU_API int temu_setVTable(temu_Class *Cls, void *VTable);
1658 
1666 
1674 TEMU_API void *temu_getVTable(const temu_Object_ *Obj);
1675 
1684 
1685 /*
1686  * Qualification support
1687  *
1688  * Qualifiers can set a tag per class, which can then be used for
1689  * quick identification of an object's class properties. For example
1690  * all objects qualified as CPUs, machines and memories must have the
1691  * vtable set appropriatelly.
1692  */
1693 #define TEMU_QUAL_NONE 0
1694 #define TEMU_QUAL_CPU 1
1695 #define TEMU_QUAL_MACHINE 2
1696 #define TEMU_QUAL_MEMORY 4
1697 #define TEMU_QUAL_COMPONENT 5
1698 #define TEMU_QUAL_CLOCK 6
1699 
1700 // Users can set their own class qualifiers, but should use an offset
1701 // from the TEMU_QUAL_USER.
1702 #define TEMU_QUAL_USER 65536
1703 
1711 TEMU_API int temu_isQualifiedAs(const temu_Object_ *Obj, unsigned Qualifier);
1712 
1720 TEMU_API int temu_isCpu(const temu_Object_ *Obj);
1721 
1730 
1738 
1746 
1755 
1764 
1771 
1778 TEMU_API void temu_qualifyAs(temu_Class *Cls, unsigned Qualifier);
1779 
1783 TEMU_API void temu_objsysClear(void);
1784 
1788 
1802 TEMU_API temu_Object_ *temu_createObject(const char *ClsName,
1803  const char *ObjName,
1804  const temu_CreateArg *Args);
1805 
1812 
1819 TEMU_API temu_Class *temu_classForName(const char *ClsName);
1820 
1827 TEMU_API const char *temu_nameForClass(temu_Class *Cls);
1828 
1836 
1844 TEMU_API int temu_classHasCommand(const temu_Class *Cls, const char *CmdName);
1845 
1846 typedef void temu_TypeObject;
1847 
1848 typedef struct {
1849  const char *Name;
1851  size_t Count;
1852  uintptr_t Offset;
1854 } temu_PropInfo;
1855 
1883 TEMU_API int temu_propInfoForClass(temu_Class *Cls, unsigned PIIndex,
1884  unsigned PICount, temu_PropInfo *PI);
1885 
1892 TEMU_API temu_Object_ *temu_objectForName(const char *Name);
1893 
1900 TEMU_API const char *temu_nameForObject(const temu_Object_ *Obj);
1901 
1909 TEMU_API const char *temu_nameForInterface(const temu_Object_ *Obj,
1910  const void *Iface);
1911 
1921 TEMU_API int temu_indexForInterface(const temu_Object_ *Obj, const void *Iface);
1922 
1930 TEMU_API const char *temu_typenameForInterface(const temu_Object_ *Obj,
1931  const void *Iface);
1932 
1953 TEMU_API int temu_loadPlugin(const char *PluginName);
1954 
1961 TEMU_API void temu_pluginPathAppend(const char *Path);
1962 
1969 TEMU_API void temu_pluginPathRemove(const char *Path);
1970 
1975 TEMU_API void temu_pluginPathPrint(void);
1976 
1983 TEMU_API const char *temu_typeToName(temu_Type Typ);
1984 
1985 /* NOTE: The getProcessors, getProcsessorCount, getComponents and
1986  getComponentCount functions are experimental and unstable. Do not
1987  rely on these for the moment.
1988 */
1996 
2002 TEMU_API size_t temu_getProcessorCount(void);
2003 
2011 
2017 TEMU_API size_t temu_getComponentCount(void);
2018 
2033 TEMU_API int temu_connect(temu_Object_ *A, const char *PropName,
2034  temu_Object_ *B, const char *IfaceName);
2035 
2050 TEMU_API int temu_serialiseJSON(const char *FileName);
2051 
2064 TEMU_API int temu_deserialiseJSON(const char *FileName);
2065 
2079 TEMU_API int temu_inlineDeserialiseJSON(const char *FileName);
2080 
2081 
2096 TEMU_API void temu_serialiseProp(void *Ctxt, const char *Name, temu_Type Typ,
2097  int Count, void *Data);
2098 
2108 TEMU_API void temu_deserialiseProp(void *Ctxt, temu_Object_ *Obj,
2109  const char *Name);
2110 
2118 TEMU_API int temu_snapshotGetLength(void *Ctxt, const char *Name);
2126 TEMU_API int temu_checkpointGetLength(void *Ctxt, const char *Name);
2127 
2136 TEMU_API temu_Propval temu_snapshotGetValue(void *Ctxt, const char *Name,
2137  int Idx);
2138 
2147 TEMU_API temu_Propval temu_checkpointGetValue(void *Ctxt, const char *Name,
2148  int Idx);
2149 
2162 TEMU_API int temu_checkSanity(int Report);
2163 
2177 TEMU_API int temu_generateObjectGraph(const char *Path, int Display);
2178 
2179 TEMU_API int temu_isValidObjectName(const char *Name);
2180 TEMU_API int temu_isValidClassName(const char *Name);
2181 TEMU_API int temu_isValidInterfaceName(const char *Name);
2182 TEMU_API int temu_isValidPropertyName(const char *Name);
2183 
2188 typedef struct {
2197  void (*serialise)(void *Obj, const char *BaseName, void *Ctxt);
2198 
2208  void (*deserialise)(void *Obj, const char *BaseName, void *Ctxt);
2209 
2216  int (*checkSanity)(void *Obj, int Report); // Optional
2217 
2224  void (*timeSourceSet)(void *Obj);
2225 
2232  void (*printObject)(void *Obj);
2234 #define TEMU_OBJECT_IFACE_TYPE "ObjectIface"
2236 
2237 
2245 TEMU_API void temu_foreachObject(void (*Func)(temu_Object_ *, void *),
2246  void *Arg);
2247 
2256 TEMU_API void temu_foreachClass(void (*Func)(temu_Class *, void *), void *Arg);
2257 
2266 TEMU_API void temu_foreachProcessor(void (*Func)(temu_Object_ *, void *),
2267  void *Arg);
2268 
2280  temu_Class *C, void (*Func)(temu_Class *, const char *, void *), void *Arg);
2281 
2293  temu_Class *C, void (*Func)(temu_Class *, const char *, void *), void *Arg);
2294 
2295 TEMU_API void *temu_registerInterfaceType(const char *Name);
2296 TEMU_API void *temu_getInterfaceType(const char *Name);
2297 
2305 TEMU_API int temu_addScalarProperty(temu_Class *Cls, const char *Name,
2306  int offset, temu_Type T,
2307  const char *Doc);
2316 TEMU_API int temu_addArrayProperty(temu_Class *Cls, const char *Name,
2317  int offset, temu_Type T, int NumElems,
2318  const char *Doc);
2319 
2326 TEMU_API int temu_addScalarPseudoProperty(temu_Class *Cls, const char *Name,
2327  temu_Type T, const char *Doc);
2328 
2336 TEMU_API int temu_addArrayPseudoProperty(temu_Class *Cls, const char *Name,
2337  temu_Type T, int NumElems,
2338  const char *Doc);
2339 
2346 TEMU_API int temu_writeProp(temu_Object_ *Obj, const char *Name, int idx,
2347  temu_Propval *PV);
2348 
2354 TEMU_API temu_Propval temu_readProp(temu_Object_ *Obj, const char *Name,
2355  int idx);
2356 
2362 TEMU_API uint64_t temu_getValueUnsigned(temu_Object_ *Obj, const char *PropName,
2363  int Idx);
2369 TEMU_API int64_t temu_getValueSigned(temu_Object_ *Obj, const char *PropName,
2370  int Idx);
2371 
2377 TEMU_API double temu_getValueDouble(temu_Object_ *Obj, const char *PropName,
2378  int Idx);
2385  const char *PropName,
2386  int Idx);
2392 TEMU_API int64_t temu_readValueSigned(temu_Object_ *Obj, const char *PropName,
2393  int Idx);
2399 TEMU_API double temu_readValueDouble(temu_Object_ *Obj, const char *PropName,
2400  int Idx);
2401 
2407 TEMU_API void temu_setValueUnsigned(temu_Object_ *Obj, const char *PropName,
2408  uint64_t Val, int Idx);
2414 TEMU_API void temu_setValueSigned(temu_Object_ *Obj, const char *PropName,
2415  int64_t Val,
2416  int Idx);
2422 TEMU_API void temu_setValueDouble(temu_Object_ *Obj, const char *PropName,
2423  double Val,
2424  int Idx);
2430 TEMU_API void temu_writeValueUnsigned(temu_Object_ *Obj, const char *PropName,
2431  uint64_t Val, int Idx);
2437 TEMU_API void temu_writeValueSigned(temu_Object_ *Obj, const char *PropName,
2438  int64_t Val,
2439  int Idx);
2445 TEMU_API void temu_writeValueDouble(temu_Object_ *Obj, const char *PropName,
2446  double Val,
2447  int Idx);
2448 
2449 
2471 
2478 TEMU_API int temu_objectHasCmd(const temu_Object_ *Obj, const char *CmdName);
2479 
2480 #ifdef __cplusplus
2481 }
2482 #endif
2483 
2484 #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:1848
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_PropAccessor temu_getPropAccessor(temu_Object *Obj, const char *PropName, int PropIdx)
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)
struct temu_PropAccessor temu_PropAccessor
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
temu_PropReader Getter
Getter function if applicable.
Definition: Objsys.h:736
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:727
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:1850
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)
void(* writeProp)(struct temu_PropAccessor *accessor, temu_Propval pv)
Write property via accessor.
Definition: Objsys.h:739
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_PropWriter Writer
Writer function if applicable.
Definition: Objsys.h:733
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)
void(* setProp)(struct temu_PropAccessor *accessor, temu_Propval pv)
Set property via accessor.
Definition: Objsys.h:741
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_PropReader Reader
Reader function if applicable.
Definition: Objsys.h:734
TEMU_API void temu_setValueSigned(temu_Object_ *Obj, const char *PropName, int64_t Val, int Idx)
Definition: Objsys.h:435
temu_Propval(* getProp)(struct temu_PropAccessor *accessor)
Get property via accessor.
Definition: Objsys.h:740
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:1851
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)
void * Data
Pointer to value if applicable.
Definition: Objsys.h:732
Definition: Objsys.h:82
temu_TypeObject * TypeObj
Definition: Objsys.h:1853
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
int Index
Index used in access, can be modified by user.
Definition: Objsys.h:730
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:1849
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)
temu_Type Typ
Type of property.
Definition: Objsys.h:728
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_Object * Obj
Pointer to object containing property.
Definition: Objsys.h:729
TEMU_API int temu_isDiscrete(temu_Propval Pv)
struct temu_IfaceRef temu_IfaceRef
uintptr_t Offset
Offset from struct start.
Definition: Objsys.h:1852
#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_PropWriter Setter
Setter function if applicable.
Definition: Objsys.h:735
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:2188
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:1846
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