Realm C++ SDK版本 v 2.2.0

macros.hpp

1
2//
3// 版权所有 2024 Realm Inc.
4//
5// 根据 Apache 许可证 2.0 版(“许可证”)获得许可;
6// 除非符合合规,否则不得使用此文件。
7// 您可以在以下网址获取许可证副本:
8//
9// http://www.apache.org/licenses/LICENSE-2.0
10//
11// 除非适用法律要求或书面同意,否则软件
12// 根据许可证分发是按“原样”分发的,
13// 不提供任何类型的Express或暗示的保证或条件。
14// 请参阅管理权限的特定语言的许可证和
15// 许可证下的限制。
16//
18
19#ifndef CPPREALM_MACROS_HPP
20#define CPPREALM_MACROS_HPP
21
22#define FE_ 0 (WHAT, cls)
23#define FE_ 1 (WHAT, cls, X) WHAT(cls, X)
24#define FE_ 2 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 1 (WHAT, cls, __VA_ARGS__)
25#define FE_ 3 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 2 (WHAT, cls, __VA_ARGS__)
26#define FE_ 4 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 3 (WHAT, cls, __VA_ARGS__)
27#define FE_ 5 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 4 (WHAT, cls, __VA_ARGS__)
28#define FE_ 6 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 5 (WHAT, cls, __VA_ARGS__)
29#define FE_ 7 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 6 (WHAT, cls, __VA_ARGS__)
30#define FE_ 8 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 7 (WHAT, cls, __VA_ARGS__)
31#define FE_ 9 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 8 (WHAT, cls, __VA_ARGS__)
32#define FE_ 10 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 9 (WHAT, cls, __VA_ARGS__)
33#define FE_ 11 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 10 (WHAT, cls, __VA_ARGS__)
34#define FE_ 12 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 11 (WHAT, cls, __VA_ARGS__)
35#define FE_ 13 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 12 (WHAT, cls, __VA_ARGS__)
36#define FE_ 14 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 13 (WHAT, cls, __VA_ARGS__)
37#define FE_ 15 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 14 (WHAT, cls, __VA_ARGS__)
38#define FE_ 16 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 15 (WHAT, cls, __VA_ARGS__)
39#define FE_ 17 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 16 (WHAT, cls, __VA_ARGS__)
40#define FE_ 18 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 17 (WHAT, cls, __VA_ARGS__)
41#define FE_ 19 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 18 (WHAT, cls, __VA_ARGS__)
42#define FE_ 20 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 19 (WHAT, cls, __VA_ARGS__)
43#define FE_ 21 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 20 (WHAT, cls, __VA_ARGS__)
44#define FE_ 22 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 21 (WHAT, cls, __VA_ARGS__)
45#define FE_ 23 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 22 (WHAT, cls, __VA_ARGS__)
46#define FE_ 24 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 23 (WHAT, cls, __VA_ARGS__)
47#define FE_ 25 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 24 (WHAT, cls, __VA_ARGS__)
48#define FE_ 26 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 25 (WHAT, cls, __VA_ARGS__)
49#define FE_ 27 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 26 (WHAT, cls, __VA_ARGS__)
50#define FE_ 28 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 27 (WHAT, cls, __VA_ARGS__)
51#define FE_ 29 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 28 (WHAT, cls, __VA_ARGS__)
52#define FE_ 30 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 29 (WHAT, cls, __VA_ARGS__)
53#define FE_ 31 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 30 (WHAT, cls, __VA_ARGS__)
54#define FE_ 32 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 31 (WHAT, cls, __VA_ARGS__)
55#define FE_ 33 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 32 (WHAT, cls, __VA_ARGS__)
56#define FE_ 34 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 33 (WHAT, cls, __VA_ARGS__)
57#define FE_ 35 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 34 (WHAT, cls, __VA_ARGS__)
58#define FE_ 36 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 35 (WHAT, cls, __VA_ARGS__)
59#define FE_ 37 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 36 (WHAT, cls, __VA_ARGS__)
60#define FE_ 38 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 37 (WHAT, cls, __VA_ARGS__)
61#define FE_ 39 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 38 (WHAT, cls, __VA_ARGS__)
62#define FE_ 40 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 39 (WHAT, cls, __VA_ARGS__)
63#define FE_ 41 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 40 (WHAT, cls, __VA_ARGS__)
64#define FE_ 42 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 41 (WHAT, cls, __VA_ARGS__)
65#define FE_ 43 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 42 (WHAT, cls, __VA_ARGS__)
66#define FE_ 44 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 43 (WHAT, cls, __VA_ARGS__)
67#define FE_ 45 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 44 (WHAT, cls, __VA_ARGS__)
68#define FE_ 46 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 45 (WHAT, cls, __VA_ARGS__)
69#define FE_ 47 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 46 (WHAT, cls, __VA_ARGS__)
70#define FE_ 48 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 47 (WHAT, cls, __VA_ARGS__)
71#define FE_ 49 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 48 (WHAT, cls, __VA_ARGS__)
72#define FE_ 50 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 49 (WHAT, cls, __VA_ARGS__)
73#define FE_ 51 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 50 (WHAT, cls, __VA_ARGS__)
74#define FE_ 52 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 51 (WHAT, cls, __VA_ARGS__)
75#define FE_ 53 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 52 (WHAT, cls, __VA_ARGS__)
76#define FE_ 54 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 53 (WHAT, cls, __VA_ARGS__)
77#define FE_ 55 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 54 (WHAT, cls, __VA_ARGS__)
78#define FE_ 56 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 55 (WHAT, cls, __VA_ARGS__)
79#define FE_ 57 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 56 (WHAT, cls, __VA_ARGS__)
80#define FE_ 58 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 57 (WHAT, cls, __VA_ARGS__)
81#define FE_ 59 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 58 (WHAT, cls, __VA_ARGS__)
82#define FE_ 60 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 59 (WHAT, cls, __VA_ARGS__)
83#define FE_ 61 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 60 (WHAT, cls, __VA_ARGS__)
84#define FE_ 62 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 61 (WHAT, cls, __VA_ARGS__)
85#define FE_ 63 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 62 (WHAT, cls, __VA_ARGS__)
86#define FE_ 64 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 63 (WHAT, cls, __VA_ARGS__)
87#define FE_ 65 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 64 (WHAT, cls, __VA_ARGS__)
88#define FE_ 66 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 65 (WHAT, cls, __VA_ARGS__)
89#define FE_ 67 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 66 (WHAT, cls, __VA_ARGS__)
90#define FE_ 68 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 67 (WHAT, cls, __VA_ARGS__)
91#define FE_ 69 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 68 (WHAT, cls, __VA_ARGS__)
92#define FE_ 70 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 69 (WHAT, cls, __VA_ARGS__)
93#define FE_ 71 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 70 (WHAT, cls, __VA_ARGS__)
94#define FE_ 72 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 71 (WHAT, cls, __VA_ARGS__)
95#define FE_ 73 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 72 (WHAT, cls, __VA_ARGS__)
96#define FE_ 74 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 73 (WHAT, cls, __VA_ARGS__)
97#define FE_ 75 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 74 (WHAT, cls, __VA_ARGS__)
98#define FE_ 76 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 75 (WHAT, cls, __VA_ARGS__)
99#define FE_ 77 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 76 (WHAT, cls, __VA_ARGS__)
100#define FE_ 78 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 77 (WHAT, cls, __VA_ARGS__)
101#define FE_ 79 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 78 (WHAT, cls, __VA_ARGS__)
102#define FE_ 80 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 79 (WHAT, cls, __VA_ARGS__)
103#define FE_ 81 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 80 (WHAT, cls, __VA_ARGS__)
104#define FE_ 82 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 81 (WHAT, cls, __VA_ARGS__)
105#define FE_ 83 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 82 (WHAT, cls, __VA_ARGS__)
106#define FE_ 84 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 83 (WHAT, cls, __VA_ARGS__)
107#define FE_ 85 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 84 (WHAT, cls, __VA_ARGS__)
108#define FE_ 86 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 85 (WHAT, cls, __VA_ARGS__)
109#define FE_ 87 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 86 (WHAT, cls, __VA_ARGS__)
110#define FE_ 88 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 87 (WHAT, cls, __VA_ARGS__)
111#define FE_ 89 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 88 (WHAT, cls, __VA_ARGS__)
112#define FE_ 90 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 89 (WHAT, cls, __VA_ARGS__)
113#define FE_ 91 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 90 (WHAT, cls, __VA_ARGS__)
114#define FE_ 92 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 91 (WHAT, cls, __VA_ARGS__)
115#define FE_ 93 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 92 (WHAT, cls, __VA_ARGS__)
116#define FE_ 94 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 93 (WHAT, cls, __VA_ARGS__)
117#define FE_ 95 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 94 (WHAT, cls, __VA_ARGS__)
118#define FE_ 96 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 95 (WHAT, cls, __VA_ARGS__)
119#define FE_ 97 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 96 (WHAT, cls, __VA_ARGS__)
120#define FE_ 98 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 97 (WHAT, cls, __VA_ARGS__)
121#define FE_ 99 (WHAT, cls, X, ...) WHAT(cls, X)FE_ 98 (WHAT, cls, __VA_ARGS__)
122#define FE_ 100 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 99 (WHAT, cls, __VA_ARGS__)
123#define FE_ 101 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 100 (WHAT, cls, __VA_ARGS__)
124#define FE_ 102 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 101 (WHAT, cls, __VA_ARGS__)
125#define FE_ 103 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 102 (WHAT, cls, __VA_ARGS__)
126#define FE_ 104 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 103 (WHAT, cls, __VA_ARGS__)
127#define FE_ 105 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 104 (WHAT, cls, __VA_ARGS__)
128#define FE_ 106 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 105 (WHAT, cls, __VA_ARGS__)
129#define FE_ 107 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 106 (WHAT, cls, __VA_ARGS__)
130#define FE_ 108 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 107 (WHAT, cls, __VA_ARGS__)
131#define FE_ 109 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 108 (WHAT, cls, __VA_ARGS__)
132#define FE_ 110 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 109 (WHAT, cls, __VA_ARGS__)
133#define FE_ 111 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 110 (WHAT, cls, __VA_ARGS__)
134#define FE_ 112 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 111 (WHAT, cls, __VA_ARGS__)
135#define FE_ 113 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 112 (WHAT, cls, __VA_ARGS__)
136#define FE_ 114 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 113 (WHAT, cls, __VA_ARGS__)
137#define FE_ 115 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 114 (WHAT, cls, __VA_ARGS__)
138#define FE_ 116 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 115 (WHAT, cls, __VA_ARGS__)
139#define FE_ 117 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 116 (WHAT, cls, __VA_ARGS__)
140#define FE_ 118 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 117 (WHAT, cls, __VA_ARGS__)
141#define FE_ 119 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 118 (WHAT, cls, __VA_ARGS__)
142#define FE_ 120 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 119 (WHAT, cls, __VA_ARGS__)
143#define FE_ 121 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 120 (WHAT, cls, __VA_ARGS__)
144#define FE_ 122 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 121 (WHAT, cls, __VA_ARGS__)
145#define FE_ 123 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 122 (WHAT, cls, __VA_ARGS__)
146#define FE_ 124 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 123 (WHAT, cls, __VA_ARGS__)
147#define FE_ 125 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 124 (WHAT, cls, __VA_ARGS__)
148#define FE_ 126 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 125 (WHAT, cls, __VA_ARGS__)
149#define FE_ 127 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 126 (WHAT, cls, __VA_ARGS__)
150#define FE_ 128 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 127 (WHAT, cls, __VA_ARGS__)
151#define FE_ 129 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 128 (WHAT, cls, __VA_ARGS__)
152#define FE_ 130 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 129 (WHAT, cls, __VA_ARGS__)
153#define FE_ 131 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 130 (WHAT, cls, __VA_ARGS__)
154#define FE_ 132 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 131 (WHAT, cls, __VA_ARGS__)
155#define FE_ 133 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 132 (WHAT, cls, __VA_ARGS__)
156#define FE_ 134 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 133 (WHAT, cls, __VA_ARGS__)
157#define FE_ 135 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 134 (WHAT, cls, __VA_ARGS__)
158#define FE_ 136 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 135 (WHAT, cls, __VA_ARGS__)
159#define FE_ 137 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 136 (WHAT, cls, __VA_ARGS__)
160#define FE_ 138 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 137 (WHAT, cls, __VA_ARGS__)
161#define FE_ 139 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 138 (WHAT, cls, __VA_ARGS__)
162#define FE_ 140 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 139 (WHAT, cls, __VA_ARGS__)
163#define FE_ 141 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 140 (WHAT, cls, __VA_ARGS__)
164#define FE_ 142 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 141 (WHAT, cls, __VA_ARGS__)
165#define FE_ 143 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 142 (WHAT, cls, __VA_ARGS__)
166#define FE_ 144 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 143 (WHAT, cls, __VA_ARGS__)
167#define FE_ 145 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 144 (WHAT, cls, __VA_ARGS__)
168#define FE_ 146 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 145 (WHAT, cls, __VA_ARGS__)
169#define FE_ 147 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 146 (WHAT, cls, __VA_ARGS__)
170#define FE_ 148 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 147 (WHAT, cls, __VA_ARGS__)
171#define FE_ 149 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 148 (WHAT, cls, __VA_ARGS__)
172#define FE_ 150 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 149 (WHAT, cls, __VA_ARGS__)
173#define FE_ 151 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 150 (WHAT, cls, __VA_ARGS__)
174#define FE_ 152 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 151 (WHAT, cls, __VA_ARGS__)
175#define FE_ 153 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 152 (WHAT, cls, __VA_ARGS__)
176#define FE_ 154 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 153 (WHAT, cls, __VA_ARGS__)
177#define FE_ 155 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 154 (WHAT, cls, __VA_ARGS__)
178#define FE_ 156 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 155 (WHAT, cls, __VA_ARGS__)
179#define FE_ 157 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 156 (WHAT, cls, __VA_ARGS__)
180#define FE_ 158 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 157 (WHAT, cls, __VA_ARGS__)
181#define FE_ 159 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 158 (WHAT, cls, __VA_ARGS__)
182#define FE_ 160 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 159 (WHAT, cls, __VA_ARGS__)
183#define FE_ 161 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 160 (WHAT, cls, __VA_ARGS__)
184#define FE_ 162 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 161 (WHAT, cls, __VA_ARGS__)
185#define FE_ 163 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 162 (WHAT, cls, __VA_ARGS__)
186#define FE_ 164 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 163 (WHAT, cls, __VA_ARGS__)
187#define FE_ 165 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 164 (WHAT, cls, __VA_ARGS__)
188#define FE_ 166 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 165 (WHAT, cls, __VA_ARGS__)
189#define FE_ 167 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 166 (WHAT, cls, __VA_ARGS__)
190#define FE_ 168 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 167 (WHAT, cls, __VA_ARGS__)
191#define FE_ 169 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 168 (WHAT, cls, __VA_ARGS__)
192#define FE_ 170 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 169 (WHAT, cls, __VA_ARGS__)
193#define FE_ 171 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 170 (WHAT, cls, __VA_ARGS__)
194#define FE_ 172 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 171 (WHAT, cls, __VA_ARGS__)
195#define FE_ 173 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 172 (WHAT, cls, __VA_ARGS__)
196#define FE_ 174 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 173 (WHAT, cls, __VA_ARGS__)
197#define FE_ 175 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 174 (WHAT, cls, __VA_ARGS__)
198#define FE_ 176 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 175 (WHAT, cls, __VA_ARGS__)
199#define FE_ 177 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 176 (WHAT, cls, __VA_ARGS__)
200#define FE_ 178 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 177 (WHAT, cls, __VA_ARGS__)
201#define FE_ 179 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 178 (WHAT, cls, __VA_ARGS__)
202#define FE_ 180 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 179 (WHAT, cls, __VA_ARGS__)
203#define FE_ 181 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 180 (WHAT, cls, __VA_ARGS__)
204#define FE_ 182 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 181 (WHAT, cls, __VA_ARGS__)
205#define FE_ 183 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 182 (WHAT, cls, __VA_ARGS__)
206#define FE_ 184 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 183 (WHAT, cls, __VA_ARGS__)
207#define FE_ 185 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 184 (WHAT, cls, __VA_ARGS__)
208#define FE_ 186 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 185 (WHAT, cls, __VA_ARGS__)
209#define FE_ 187 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 186 (WHAT, cls, __VA_ARGS__)
210#define FE_ 188 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 187 (WHAT, cls, __VA_ARGS__)
211#define FE_ 189 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 188 (WHAT, cls, __VA_ARGS__)
212#define FE_ 190 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 189 (WHAT, cls, __VA_ARGS__)
213#define FE_ 191 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 190 (WHAT, cls, __VA_ARGS__)
214#define FE_ 192 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 191 (WHAT, cls, __VA_ARGS__)
215#define FE_ 193 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 192 (WHAT, cls, __VA_ARGS__)
216#define FE_ 194 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 193 (WHAT, cls, __VA_ARGS__)
217#define FE_ 195 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 194 (WHAT, cls, __VA_ARGS__)
218#define FE_ 196 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 195 (WHAT, cls, __VA_ARGS__)
219#define FE_ 197 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 196 (WHAT, cls, __VA_ARGS__)
220#define FE_ 198 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 197 (WHAT, cls, __VA_ARGS__)
221#define FE_ 199 (WHAT, cls, X, ...) WHAT(cls, X) FE_ 198 (WHAT, cls, __VA_ARGS__)
222
223#define GET_MACRO(_ 0 , _ 1 , _ 2 , _ 3 , _ 4 , _ 5 , _ 6 , _ 7 , _ 8 , _ 9 , _ 10 , _ 11 , _ 12 , \
224 _ 13 , _ 14 , _ 15 , _ 16 , _ 17 , _ 18 , _ 19 , _ 20 , _ 21 , _ 22 , _ 23 、 _ 24 、 _ 25 、 _ 26 、\
225 _ 27 , _ 28 , _ 29 , _ 30 , _ 31 , _ 32 , _ 33 , _ 34 , _ 35 , _ 36 , _ 37 、 _ 38 、 _ 39 、 _ 40 、\
226 _ 41 , _ 42 , _ 43 , _ 44 , _ 45 , _ 46 , _ 47 , _ 48 , _ 49 , _ 50 , _ 51 、 _ 52 、 _ 53 、 _ 54 、\
227 _ 55 , _ 56 , _ 57 , _ 58 , _ 59 , _ 60 , _ 61 , _ 62 , _ 63 , _ 64 , _ 65 、 _ 66 、 _ 67 、 _ 68 、\
228 _ 69 , _ 70 , _ 71 , _ 72 , _ 73 , _ 74 , _ 75 , _ 76 , _ 77 , _ 78 , _ 79 、 _ 80 、 _ 81 、 _ 82 、\
229 _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, \
230 _ 97 , _ 98 , _ 99 , _ 100 , _ 101 , _ 102 , _ 103 , _ 104 , _ 105 , _ 106 , _ 107 , _ 108 , _ 109 , \
231 _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, \
232 _122, _123, _124, _125, _126, _127, _128, _129, _130, _131, _132, _133, \
233 _134, _135, _136, _137, _138, _139, _140, _141, _142, _143, _144, _145, \
234 _146, _147, _148, _149, _150, _151, _152, _153, _154, _155, _156, _157, \
235 _158, _159, _160, _161, _162, _163, _164, _165, _166, _167, _168, _169, \
236 _170, _171, _172, _173, _174, _175, _176, _177, _178, _179, _180, _181, \
237 _182, _183, _184, _185, _186, _187, _188, _189, _190, _191, _192, _193, \
238 _ 194 , _ 195 , _ 196 , _ 197 , _ 198 , _ 199 , NAME, ...) NAME\
239
240#define FOR_EACH(动作, cls, ...) \
241 GET_MACRO(_0, __VA_ARGS__, \
242 FE_ 199 、FE_ 198 、FE_ 197 、FE_ 196 、FE_ 195 、FE_ 194 、FE_ 193 、FE_ 192 、FE_ 191 、FE_ 190 、 \
243 FE_ 189 、FE_ 188 、FE_ 187 、FE_ 186 、FE_ 185 、FE_ 184 、FE_ 183 、FE_ 182 、FE_ 181 、FE_ 180 、 \
244 FE_ 179 、FE_ 178 、FE_ 177 、FE_ 176 、FE_ 175 、FE_ 174 、FE_ 173 、FE_ 172 、FE_ 171 、FE_ 170 、 \
245 FE_ 169 、FE_ 168 、FE_ 167 、FE_ 166 、FE_ 165 、FE_ 164 、FE_ 163 、FE_ 162 、FE_ 161 、FE_ 160 、 \
246 FE_ 159 、FE_ 158 、FE_ 157 、FE_ 156 、FE_ 155 、FE_ 154 、FE_ 153 、FE_ 152 、FE_ 151 、FE_ 150 、 \
247 FE_ 149 、FE_ 148 、FE_ 147 、FE_ 146 、FE_ 145 、FE_ 144 、FE_ 143 、FE_ 142 、FE_ 141 、FE_ 140 、 \
248 FE_ 139 、FE_ 138 、FE_ 137 、FE_ 136 、FE_ 135 、FE_ 134 、FE_ 133 、FE_ 132 、FE_ 131 、FE_ 130 、 \
249 FE_ 129 、FE_ 128 、FE_ 127 、FE_ 126 、FE_ 125 、FE_ 124 、FE_ 123 、FE_ 122 、FE_ 121 、FE_ 120 、 \
250 FE_ 119 、FE_ 118 、FE_ 117 、FE_ 116 、FE_ 115 、FE_ 114 、FE_ 113 、FE_ 112 、FE_ 111 、FE_ 110 、 \
251 FE_ 109 、FE_ 108 、FE_ 107 、FE_ 106 、FE_ 105 、FE_ 104 、FE_ 103 、FE_ 102 、FE_ 101 、FE_ 100 、 \
252 FE_ 99 、FE_ 98 、FE_ 97 、FE_ 96 、FE_ 95 、FE_ 94 、FE_ 93 、FE_ 92 、FE_ 91 、FE_ 90 、 \
253 FE_ 89 、FE_ 88 、FE_ 87 、FE_ 86 、FE_ 85 、FE_ 84 、FE_ 83 、FE_ 82 、FE_ 81 、FE_ 80 、 \
254 FE_ 79 、FE_ 78 、FE_ 77 、FE_ 76 、FE_ 75 、FE_ 74 、FE_ 73 、FE_ 72 、FE_ 71 、FE_ 70 、 \
255 FE_ 69 、FE_ 68 、FE_ 67 、FE_ 66 、FE_ 65 、FE_ 64 、FE_ 63 、FE_ 62 、FE_ 61 、FE_ 60 、 \
256 FE_ 59 、FE_ 58 、FE_ 57 、FE_ 56 、FE_ 55 、FE_ 54 、FE_ 53 、FE_ 52 、FE_ 51 、FE_ 50 、 \
257 FE_ 49 、FE_ 48 、FE_ 47 、FE_ 46 、FE_ 45 、FE_ 44 、FE_ 43 、FE_ 42 、FE_ 41 、FE_ 40 、 \
258 FE_ 39 、FE_ 38 、FE_ 37 、FE_ 36 、FE_ 35 、FE_ 34 、FE_ 33 、FE_ 32 、FE_ 31 、FE_ 30 、 \
259 FE_ 29 、FE_ 28 、FE_ 27 、FE_ 26 、FE_ 25 、FE_ 24 、FE_ 23 、FE_ 22 、FE_ 21 、FE_ 20 、 \
260 FE_ 19 、FE_ 18 、FE_ 17 、FE_ 16 、FE_ 15 、FE_ 14 、FE_ 13 、FE_ 12 、FE_ 11 、FE_ 10 、 \
261 FE_ 9 、FE_ 8 、FE_ 7 、FE_ 6 、FE_ 5 、FE_ 4 、FE_ 3 、FE_ 2 、FE_ 1 、FE_ 0 ) (action, cls, __VA_ARGS__)
262
263命名空间域 {
264 template < typename T, typename = void >
265 struct 托管;
266 }
267
268#define DECLARE_PERSISTED(cls, property) Managed<decltype(cls::property)> property;
269#define DECLARE_PROPERTY(cls, p) 域:: 属性<&cls::p>(#p),
270#define DECLARE_MANAGED_PROPERTY(cls, p) &realm:: 托管<cls>::p,
271#define DECLARE_MANAGED_PROPERTY_NAME(cls, p) #p,
272#define DECLARE_COND_UNMANAGED_TO_MANAGED(cls, p) if constexpr (std::is_same_v<decltype(ptr), decltype(&cls::p)>) { return &managed<cls>::p; } }
273
274#include <utility>
275
276#include <cpprealm/internal/bridge/col_key.hpp>
277#include <cpprealm/internal/bridge/obj.hpp>
278#include <cpprealm/internal/bridge/ 对象.hpp>
279#include <cpprealm/internal/bridge/ 属性>
280#include <cpprealm/internal/bridge/ 查询.hpp>
281#include <cpprealm/internal/bridge/realm.hpp>
282
283命名空间域 {
284 class rbool;
285
287 protected
288 Managed_base () = 默认 ;
289 Managed_base ( const Managed_base & other) {
290 m_obj = other.m_obj;
291 m_realm = other.m_realm;
292 m_key = other.m_key;
293 m_rbool_query = other.m_rbool_query;
294 }
295 Managed_base & Operator=( const Managed_base & other) {
296 m_obj = other.m_obj;
297 m_realm = other.m_realm;
298 m_key = other.m_key;
299 m_rbool_query = other.m_rbool_query;
300 return * this ;
301 }
302 managed_base ( managed_base && other) {
303 m_obj = std::move(other.m_obj);
304 m_realm = std::move(other.m_realm);
305 m_key = std::move(other.m_key);
306 m_rbool_query = std::move(other.m_rbool_query);
307 }
308 Managed_base & Operator=( managed_base && other) {
309 m_obj = std::move(other.m_obj);
310 m_realm = std::move(other.m_realm);
311 m_key = std::move(other.m_key);
312 m_rbool_query = std::move(other.m_rbool_query);
313 return * this ;
314 }
315 ~managed_base () {
316 m_obj = nullptr;
317 m_realm = nullptr;
318 m_rbool_query = nullptr ;
319 m_key.~col_key();
320 }
321 public :
322 静态 constexpr bool is_object = false ;
323 Internal::bridge::obj *m_obj = nullptr
324 Internal::bridge:: Realm *m_realm = nullptr ;
326 // MARK: 查询
327 rbool * m_rbool_query = nullptr ;
328
329 void assign( internal::bridge::obj *obj,
332 this->m_obj = obj;
333 this->m_realm = 域;
334 this->m_key = key;
335 }
336
337 void assign( internal::bridge::obj *obj,
339 const Internal::bridge::col_key &key) {
340 this->m_obj = obj;
341 this->m_realm = 域;
342 this->m_key = key;
343 }
344
345 template < typename T>
346 Managed_base & Operator =( const T& v) {
347 if constexpr (std::is_same_v<T, std::nullopt_t>) {
348 m_obj->set_null(m_key);
349 } else {
350 m_obj->template 设立<typenameinternal::type_info::type_info<T, void>::internal_type>(m_key, v);
351 }
352 return * this ;
353 }
354
355 void prepare_for_query( Internal::bridge:: 域 * 域,
356 const 内部::桥::表和表,
357 const std::string_view& col_name,
358 域::rbool * query_builder) {
359 this->m_realm = 域;
360 this->m_key =table.get_column_key(col_name);
361 this->m_rbool_query = query_builder;
362 }
363 };
364
365 template < typename T, typename >
366 struct 托管
367 }
368
369#define __cpprealm_build_query(op, name, type) \
370rbool 托管<type>:: 操作符 op(const type& rhs) const noException { \
371 if (this->m_rbool_query) { \
372 return this->m_rbool_query->name(m_key, rhs); \
373 } \
374 返回序列化(分离()) op序列化(rhs); \
375} \
376
377#define __cpprealm_build_Optional_query(op, name, type) \
378rbool 托管<std::Optional<type>>:: 操作符 op(const std::Optional<type>& rhs) const noException { \
379 if (this->m_rbool_query) { \
380 return this->m_rbool_query->name(m_key, rhs); \
381 } \
382 返回序列化(分离()) op序列化(rhs); \
383} \
384
385#define REALM_SCHEMA(cls, ...) \
386 DECLARE_REALM_SCHEMA(cls, false, false, ObjectType::TopLevel, __VA_ARGS__) \
387
388#define REALM_EMBEDDED_SCHEMA(cls, ...) \
389 DECLARE_REALM_SCHEMA(cls, true, false, ObjectType::Embedded, __VA_ARGS__)
390
391#define REALM_ASYMMETRIC_SCHEMA(cls, ...) \
392 DECLARE_REALM_SCHEMA(cls, false, true, ObjectType::Asymmetric, __VA_ARGS__)
393
394#define DECLARE_REALM_SCHEMA(cls, is_embedded_object, is_asymmetric_object, obj_type, ...) \
395 template <> 托管<cls> { \
396 托管() = 默认; \
397 static constexpr ObjectType object_type = obj_type; \
398 FOR_EACH(DECLARE_PERSISTED, cls, __VA_ARGS__) \
399 static constexpr auto 模式 = 域:: 模式(#cls, object_type, std::tuple{ FOR_EACH(DECLARE_PROPERTY, cls, __VA_ARGS__) } ); \
400 static constexpr automanaged_pointers() { \
401 return std::tuple{FOR_EACH(DECLARE_MANAGED_PROPERTY, cls, __VA_ARGS__)}; \
402 } \
403 template <typename PtrType> static constexpr auto unmanaged_to_managed_pointer(PtrType ptr) { \
404 FOR_EACH(DECLARE_COND_UNMANAGED_TO_MANAGED, cls, __VA_ARGS__); \
405 } \
406 static constexpr automanaged_pointers_names() { \
407 constexpr auto Managed_pointers_names = std:: 大量<std::string_view, std::tuple_size<decltype(std::make_tuple(__VA_ARGS__))>::value>{FOR_EACH(DECLARE_MANAGED_PROPERTY_NAME, cls, __VA_ARGS__)}; \
408 returninternal::array_to_tuple(managed_pointers_names); \
409 } \
410 \
411 static constexpr bool is_object = true; \
412 显式托管(const内部::bridge::obj& obj,\
413 Internal::bridge:: 域 域) \
414 : m_obj(std::move(obj)) \
415 , m_realm(std::move(域)) \
416 {\
第 417 章 auto zipped =Internal::zip_tuples(managed_pointers(), Managed_pointers_names()); \
418 std:: 应用([&](auto& ...pair) { \
419 ((*this.*pair.first). assign(&m_obj, &m_realm, m_obj.get_table().get_column_key(pair.second)), ...); \
420 }, zipped); \
第 421 章 } \
第 422 章 托管(const Managed& other) { \
第 423 章 m_obj = other.m_obj; \
424 m_realm = other.m_realm; \
第 425 章 m_rbool_query = other.m_rbool_query; \
426 auto zipped =Internal::zip_tuples(managed_pointers(), Managed_pointers_names()); \
第 427 章 if (m_rbool_query) { \
428 auto 模式 = m_realm。 模式().find(other. 模式.name); \
429 auto 群组 = m_realm.read_group(); \
430 auto tab_ref = 群组.get_table(模式.table_key()); \
第 431 章 std:: 应用([&](auto& ...pair) { \
第 432 章 ((*this.*pair.first).prepare_for_query(&m_realm, Table_ref,pair.second, m_rbool_query), ...); \
第 433 章 }, zipped); \
第 434 章 } else { \
第 435 章 std:: 应用([&](auto& ...pair) { \
第 436 章 ((*this.*pair.first). assign(&m_obj, &m_realm, m_obj.get_table().get_column_key(pair.second)), ...); \
第 437 章 }, zipped); \
第 438 章 } \
第 439 章 } \
440 Managed& Operator=(const Managed& other) { \
441 m_obj = other.m_obj; \
第 442 章 m_realm = other.m_realm; \
443 m_rbool_query = other.m_rbool_query; \
第 444 章 auto zipped =Internal::zip_tuples(managed_pointers(), Managed_pointers_names()); \
445 if (m_rbool_query) { \
第 446 章 auto 模式 = m_realm。 模式().find(other. 模式.name); \
447 auto 群组 = m_realm.read_group(); \
第 448 章 auto tab_ref = 群组.get_table(模式.table_key()); \
第 449 章 std:: 应用([&](auto& ...pair) { \
450 ((*this.*pair.first).prepare_for_query(&m_realm, Table_ref,pair.second, m_rbool_query), ...); \
第 451 章 }, zipped); \
第 452 章 } else { \
453 std:: 应用([&](auto& ...pair) { \
第 454 章 ((*this.*pair.first). assign(&m_obj, &m_realm, m_obj.get_table().get_column_key(pair.second)), ...); \
455 }, zipped); \
第 456 章 } \
第 457 章 return *this; \
第 458 章 } \
第 459 章 托管(托管&&其他){\
460 m_obj = std::move(other.m_obj); \
第 461 章 m_realm = std::move(other.m_realm); \
第 462 章 m_rbool_query = std::move(other.m_rbool_query); \
第 463 章 auto zipped =Internal::zip_tuples(managed_pointers(), Managed_pointers_names()); \
第 464 章 if (m_rbool_query) { \
第 465 章 auto 模式 = m_realm。 模式().find(other. 模式.name); \
第 466 章 auto 群组 = m_realm.read_group(); \
第 467 章 auto tab_ref = 群组.get_table(模式.table_key()); \
468 std:: 应用([&](auto& ...pair) { \
469 ((*this.*pair.first).prepare_for_query(&m_realm, Table_ref,pair.second, m_rbool_query), ...); \
第 470 章 }, zipped); \
第 471 章 } else { \
472 std:: 应用([&](auto& ...pair) { \
473 ((*this.*pair.first). assign(&m_obj, &m_realm, m_obj.get_table().get_column_key(pair.second)), ...); \
474 }, zipped); \
475 } \
476 } \
477 Managed& Operator=(managed&& other) { \
478 m_obj = std::move(other.m_obj); \
479 m_realm = std::move(other.m_realm); \
480 m_rbool_query = std::move(other.m_rbool_query); \
481 auto zipped =Internal::zip_tuples(managed_pointers(), Managed_pointers_names()); \
482 if (m_rbool_query) { \
483 auto 模式 = m_realm。 模式().find(other. 模式.name); \
484 auto 群组 = m_realm.read_group(); \
485 auto tab_ref = 群组.get_table(模式.table_key()); \
486 std:: 应用([&](auto& ...pair) { \
487 ((*this.*pair.first).prepare_for_query(&m_realm, Table_ref,pair.second, m_rbool_query), ...); \
488 }, zipped); \
489 } else { \
490 std:: 应用([&](auto& ...pair) { \
491 ((*this.*pair.first). assign(&m_obj, &m_realm, m_obj.get_table().get_column_key(pair.second)), ...); \
492 }, zipped); \
493 } \
494 return *this; \
495 } \
496 static 托管 prepare_for_query(constinternal::bridge::realm&r, 域::rbool*q) { \
497 托管<cls> m; \
498 m.m_realm = r; \
499 m.m_rbool_query = q; \
500 auto schema = m.m_realm.schema().find(m.schema.name); \
501 auto 群组 = m.m_realm.read_group(); \
502 auto tab_ref = 群组.get_table(模式.table_key()); \
503 auto zipped =Internal::zip_tuples(managed_pointers(), Managed_pointers_names()); \
504 std:: 应用([&m, &table_ref](auto& ...pair) { \
505 ((m.*pair.first).prepare_for_query(&m.m_realm,table_ref,pair.second, m.m_rbool_query), ...); \
506 }, zipped); \
507 return m; \
508 } \
509 cls detach() const { \
510 cls v; \
511 auto assign = [&v, this](auto&pair) { \
512 v.*(std::decay_t<decltype(pair.first)>::ptr) = ((*this).*(pair.second)).detach(); \
513 }; \
514 auto zipped =Internal::zip_tuples(托管<cls>:: 模式.ps, 托管<cls>::managed_pointers()); \
515 std:: 应用([&Assign](auto& ...pair) { \
516 (分配(对),...); \
517 }, zipped); \
518 return v; \
519 } \
520 auto watch(std::function<void(域::object_change<managed> &&)>&& fn) { \
521 auto m_object = std::make_shared(m_realm,<internal::bridge::object> m_obj); \
522 autowrapper =<managed> 域::object_change_callback_wrapper{\
523 std::move(fn), this, m_object}; \
524 return m_object->add_notification_callback( \
525 std::make_shared< 域::object_change_callback_wrapper<managed> >(wrapper)); \
526 } \
527 bool is_invalidated() { \
528 return !m_obj.is_valid(); \
529 } \
530 bool is_frozen() { \
531 return m_realm.is_frozen(); \
532 } \
533 托管<cls> Freeze() { \
534 auto 域 = m_realm.freeze(); \
535 return 托管<cls>(域.import_copy_of(m_obj), 域); \
536 } \
537 托管<cls> thaw() { \
538 if (is_invalidated()) { \
539throw std::runtime_error("无效的对象无法解冻。" ); \
540 } \
541 if (!is_frozen()) { \
542 return *this; \
543 } \
544 auto thawed_realm = m_realm.thaw(); \
545 return 托管<cls>(thawed_realm.import_copy_of(m_obj), thawed_realm); \
546 } \
547 db get_realm() { \
548 return db(m_realm); \
549 } \
550 bool Operator ==(const Managed<cls>& other) const { \
551 if (m_rbool_query != nullptr) \
552 throw std::runtime_error("This比较操作符在 `where` 内无效"); \
553 auto& a = m_obj; \
554 auto& b = other.m_obj; \
555 if (m_realm != other.m_realm) {\
556返回 false; \
557 } \
558 return a.get_table() == b.get_table() \
559 && a.get_key() == b.get_key(); \
560 } \
561 bool 操作符 ==(const 托管<cls*>& other) const { \
562 if (m_rbool_query != nullptr) \
563 throw std::runtime_error("This比较操作符在 `where` 内无效"); \
564 auto& a = m_obj; \
565 auto& b = other.m_obj; \
566 if (m_realm != other->m_realm) { \
567返回 false; \
568 } \
569 return a.get_table() == b->get_table() \
570 && a.get_key() == b->get_key(); \
571 } \
572 bool Operator !=(const Managed<cls>& other) const { \
573 return !this-> 操作符 ==(other); \
574 } \
575 bool 操作符 !=(const 托管<cls*>& other) const { \
576 return !this-> 操作符 ==(other); \
577 } \
578 bool Operator < (const Managed<cls>& rhs) const { \
579 return m_obj.get_key() < rhs.m_obj.get_key(); \
580 } \
581 void to_json(std::ostream& out) const noException { \
582 m_obj.to_json(out); \
583 } \
584 private: \
585内部::桥::obj m_obj; \
586 internal::bridge::realm m_realm; \
587 rbool* m_rbool_query = nullptr; \
588 Friend struct db; \
589模板 友元结构托管; \
590 template <typename, typename>Friend struct Box; \
591 template <typename>Friend struct:: 域::thread_Safe_reference; \
592 template <typename T>Friend rbool*:: 域::Internal::get_rbool(const T&); \
593 \
594 }; \
595 struct meta_schema_##cls { \
596 meta_schema_##cls() { \
597 auto s = 托管<cls>:: 模式.to_core_schema(); \
598 auto it = std::find(std::begin(realm::db::schemas), std::end(realm::db::schemas), s); \
599 if (it == std::end(realm::db::schemas)) \
600 realm::db::schemas.push_back(s); \
601 } \
602 }; \
603 static inline meta_schema_##cls _meta_schema_##cls{};
604
605命名空间realm::internal {
606 /*
607 * 用于提取私有“m_rbool_query”的辅助方法
608 *托管<T>对象上的属性。
609 */
610 template < typename T>
611 rbool* get_rbool(const T& o) {
612 return o.m_rbool_query;
613 }
614 }
615
616#endif //CPREALM_MACROS_HPP
定义: rbool.hpp:36
定义: col_key.hpp: 28
定义: obj.hpp:123
定义: realm.hpp: 67
定义: table.hpp:40
定义: macros.hpp:286
定义: obj.hpp:62