CX Framework
Cross-platform C utility framework
Loading...
Searching...
No Matches
tqmonitor.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/struct.h>
8
9CX_C_BEGIN
10
11typedef struct TaskQueue TaskQueue;
12typedef struct TaskQueue_WeakRef TaskQueue_WeakRef;
13typedef struct TQMonitor TQMonitor;
14typedef struct TQMonitor_WeakRef TQMonitor_WeakRef;
15saDeclarePtr(TQMonitor);
16saDeclarePtr(TQMonitor_WeakRef);
17#define _sti_TQMonitor _sti_object
18#define SType_TQMonitor TQMonitor*
19#define STStorageType_TQMonitor TQMonitor*
20#define STypeArg_TQMonitor(type, val) stgeneric(object, (ObjInst*)objInstCheckClass(TQMonitor, val))
21#define STypeArgPtr_TQMonitor(type, val) (stgeneric*)objInstCheckClassPtr(TQMonitor, val)
22#define STypeCheckedArg_TQMonitor(type, val) stType(type), stArg(type, val)
23#define STypeCheckedPtrArg_TQMonitor(type, val) stType(type), stArgPtr(type, val)
24
25typedef struct TQMonitor_ClassIf {
26 ObjIface* _implements;
27 ObjIface* _parent;
28 size_t _size;
29
30 bool (*start)(_In_ void* self, _In_ TaskQueue* tq);
31 int64 (*tick)(_In_ void* self);
32 bool (*stop)(_In_ void* self);
33} TQMonitor_ClassIf;
34extern TQMonitor_ClassIf TQMonitor_ClassIf_tmpl;
35
36typedef struct TQMonitor {
37 union {
38 TQMonitor_ClassIf* _;
39 void* _is_TQMonitor;
40 void* _is_ObjInst;
41 };
42 ObjClassInfo* _clsinfo;
43 atomic(uintptr) _ref;
44 atomic(ptr) _weakref;
45
46 TaskQueue* tq;
48} TQMonitor;
49extern ObjClassInfo TQMonitor_clsinfo;
50#define TQMonitor(inst) objInstCheckClass(TQMonitor, inst)
51#define TQMonitorNone ((TQMonitor*)NULL)
52
53typedef struct TQMonitor_WeakRef {
54 union {
55 ObjInst* _inst;
56 void* _is_TQMonitor_WeakRef;
57 void* _is_ObjInst_WeakRef;
58 };
59 atomic(uintptr) _ref;
60 RWLock _lock;
61} TQMonitor_WeakRef;
62#define TQMonitor_WeakRef(inst) objWeakRefCheckClass(TQMonitor, inst)
63
64// bool tqmonitorStart(TQMonitor* self, TaskQueue* tq);
65#define tqmonitorStart(self, tq) (self)->_->start(TQMonitor(self), TaskQueue(tq))
66// int64 tqmonitorTick(TQMonitor* self);
67#define tqmonitorTick(self) (self)->_->tick(TQMonitor(self))
68// bool tqmonitorStop(TQMonitor* self);
69#define tqmonitorStop(self) (self)->_->stop(TQMonitor(self))
70
71CX_C_END
#define saDeclarePtr(name)
Definition sarray.h:100
CX Struct System - Introspectable, serializable POD structures in C.
CX Object System - Object-oriented programming in C.
Queue monitoring configuration for detecting stalled tasks.
Shared types and configuration structures for the task queue system.