CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
ssdtreeobj.h
1#pragma once
2// This header file is auto-generated!
3// Do not make changes to this file or they will be overwritten.
4// clang-format off
5#include <cx/obj.h>
6#include <cx/ssdtree/ssdshared.h>
7#include <cx/thread/mutex.h>
8
9typedef struct SSDTree SSDTree;
10typedef struct SSDTree_WeakRef SSDTree_WeakRef;
11saDeclarePtr(SSDTree);
12saDeclarePtr(SSDTree_WeakRef);
13
14#ifdef SSD_LOCK_DEBUG
15typedef struct SSDTreeDebug {
16 Mutex mtx;
17 sa_SSDLockDebug readlocks;
18 sa_SSDLockDebug writelocks;
19} SSDTreeDebug;
20#else
21typedef struct SSDTreeDebug {
22 uint32 _dummy;
23} SSDTreeDebug;
24#endif
25
26typedef struct SSDTree_ClassIf {
27 ObjIface* _implements;
28 ObjIface* _parent;
29 size_t _size;
30
31 _objfactory_guaranteed SSDNode* (*createNode)(_In_ void* self, _In_range_(SSD_Create_None+1, SSD_Create_Count-1) SSDCreateType crtype);
32} SSDTree_ClassIf;
33extern SSDTree_ClassIf SSDTree_ClassIf_tmpl;
34
35typedef struct SSDTree {
36 union {
37 SSDTree_ClassIf* _;
38 void* _is_SSDTree;
39 void* _is_ObjInst;
40 };
41 ObjClassInfo* _clsinfo;
42 atomic(uintptr) _ref;
43 atomic(ptr) _weakref;
44
45 RWLock lock;
46 SSDTreeDebug dbg;
47 uint32 flags;
48 int64 modified; // The most recent last-modified timestamp of any node in the tree
49 SSDNodeFactory factories[SSD_Create_Count]; // Factory functions for if this tree wants to use derived node classes
50} SSDTree;
51extern ObjClassInfo SSDTree_clsinfo;
52#define SSDTree(inst) ((SSDTree*)(unused_noeval((inst) && &((inst)->_is_SSDTree)), (inst)))
53#define SSDTreeNone ((SSDTree*)NULL)
54
55typedef struct SSDTree_WeakRef {
56 union {
57 ObjInst* _inst;
58 void* _is_SSDTree_WeakRef;
59 void* _is_ObjInst_WeakRef;
60 };
61 atomic(uintptr) _ref;
62 RWLock _lock;
63} SSDTree_WeakRef;
64#define SSDTree_WeakRef(inst) ((SSDTree_WeakRef*)(unused_noeval((inst) && &((inst)->_is_SSDTree_WeakRef)), (inst)))
65
66_objfactory_guaranteed SSDTree* SSDTree_create(uint32 flags);
67// SSDTree* ssdtreeCreate(uint32 flags);
68#define ssdtreeCreate(flags) SSDTree_create(flags)
69
70// SSDNode* ssdtreeCreateNode(SSDTree* self, SSDCreateType crtype);
71#define ssdtreeCreateNode(self, crtype) (self)->_->createNode(SSDTree(self), crtype)
72
#define saDeclarePtr(name)
Definition sarray.h:98
#define _objfactory_guaranteed
Definition objimpl.h:104
enum SSD_CREATE_TYPE_ENUM SSDCreateType
Node creation types for specifying which kind of node to create.
@ SSD_Create_None
Do not create a node.
Definition ssdshared.h:25
@ SSD_Create_Count
Total number of creation types (internal use)
Definition ssdshared.h:30
Mutex synchronization primitive.
CX Object System - Object-oriented programming in C.
Definition mutex.h:60