1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
============================================================================
Name : hev-object-atomic.h
Author : hev <r@hev.cc>
Copyright : Copyright (c) 2024 hev
Description : Object with atomic ref-count
============================================================================
*/
#ifndef __HEV_OBJECT_ATOMIC_H__
#define __HEV_OBJECT_ATOMIC_H__
#include <hev-object.h>
#ifdef __cplusplus
extern "C" {
#endif
#define HEV_OBJECT_ATOMIC(p) ((HevObjectAtomic *)p)
#define HEV_OBJECT_ATOMIC_CLASS(p) ((HevObjectAtomicClass *)p)
#define HEV_OBJECT_ATOMIC_TYPE (hev_object_atomic_class ())
typedef struct _HevObjectAtomic HevObjectAtomic;
typedef struct _HevObjectAtomicClass HevObjectAtomicClass;
struct _HevObjectAtomic
{
HevObject base;
};
struct _HevObjectAtomicClass
{
HevObjectClass base;
};
/**
* hev_object_atomic_class:
*
* Get the class of #HevObjectAtomic.
*
* Returns: a #HevObjectClass
*
* Since: 5.3
*/
HevObjectClass *hev_object_atomic_class (void);
/**
* hev_object_atomic_construct:
* @self: a #HevObjectAtomic
*
* Construct a new object with atomic ref-count.
*
* Returns: When successful, returns zero. otherwise, returns -1.
*
* Since: 5.3
*/
int hev_object_atomic_construct (HevObjectAtomic *self);
#ifdef __cplusplus
}
#endif
#endif /* __HEV_OBJECT_ATOMIC_H__ */