1 #include "future-value.h"
2 
3 /**************************************************
4  *
5  * Generated by build/generate-future-functions.py.
6  *
7  * DO NOT EDIT THIS FILE.
8  *
9  *************************************************/
10 /* clang-format off */
11 
12 future_value_t *
future_value_new()13 future_value_new ()
14 {
15    return (future_value_t *) bson_malloc0 (sizeof (future_value_t));
16 }
17 
18 void
future_value_set_void(future_value_t * future_value)19 future_value_set_void (future_value_t *future_value)
20 {
21    future_value->type = future_value_void_type;
22 }
23 
24 void
future_value_get_void(future_value_t * future_value)25 future_value_get_void (future_value_t *future_value)
26 {
27    BSON_ASSERT (future_value->type == future_value_void_type);
28 }
29 
30 
31 void
future_value_set_bool(future_value_t * future_value,bool value)32 future_value_set_bool (future_value_t *future_value, bool value)
33 {
34    future_value->type = future_value_bool_type;
35    future_value->bool_value = value;
36 }
37 
38 bool
future_value_get_bool(future_value_t * future_value)39 future_value_get_bool (future_value_t *future_value)
40 {
41    BSON_ASSERT (future_value->type == future_value_bool_type);
42    return future_value->bool_value;
43 }
44 
45 void
future_value_set_char_ptr(future_value_t * future_value,char_ptr value)46 future_value_set_char_ptr (future_value_t *future_value, char_ptr value)
47 {
48    future_value->type = future_value_char_ptr_type;
49    future_value->char_ptr_value = value;
50 }
51 
52 char_ptr
future_value_get_char_ptr(future_value_t * future_value)53 future_value_get_char_ptr (future_value_t *future_value)
54 {
55    BSON_ASSERT (future_value->type == future_value_char_ptr_type);
56    return future_value->char_ptr_value;
57 }
58 
59 void
future_value_set_char_ptr_ptr(future_value_t * future_value,char_ptr_ptr value)60 future_value_set_char_ptr_ptr (future_value_t *future_value, char_ptr_ptr value)
61 {
62    future_value->type = future_value_char_ptr_ptr_type;
63    future_value->char_ptr_ptr_value = value;
64 }
65 
66 char_ptr_ptr
future_value_get_char_ptr_ptr(future_value_t * future_value)67 future_value_get_char_ptr_ptr (future_value_t *future_value)
68 {
69    BSON_ASSERT (future_value->type == future_value_char_ptr_ptr_type);
70    return future_value->char_ptr_ptr_value;
71 }
72 
73 void
future_value_set_int(future_value_t * future_value,int value)74 future_value_set_int (future_value_t *future_value, int value)
75 {
76    future_value->type = future_value_int_type;
77    future_value->int_value = value;
78 }
79 
80 int
future_value_get_int(future_value_t * future_value)81 future_value_get_int (future_value_t *future_value)
82 {
83    BSON_ASSERT (future_value->type == future_value_int_type);
84    return future_value->int_value;
85 }
86 
87 void
future_value_set_int64_t(future_value_t * future_value,int64_t value)88 future_value_set_int64_t (future_value_t *future_value, int64_t value)
89 {
90    future_value->type = future_value_int64_t_type;
91    future_value->int64_t_value = value;
92 }
93 
94 int64_t
future_value_get_int64_t(future_value_t * future_value)95 future_value_get_int64_t (future_value_t *future_value)
96 {
97    BSON_ASSERT (future_value->type == future_value_int64_t_type);
98    return future_value->int64_t_value;
99 }
100 
101 void
future_value_set_size_t(future_value_t * future_value,size_t value)102 future_value_set_size_t (future_value_t *future_value, size_t value)
103 {
104    future_value->type = future_value_size_t_type;
105    future_value->size_t_value = value;
106 }
107 
108 size_t
future_value_get_size_t(future_value_t * future_value)109 future_value_get_size_t (future_value_t *future_value)
110 {
111    BSON_ASSERT (future_value->type == future_value_size_t_type);
112    return future_value->size_t_value;
113 }
114 
115 void
future_value_set_ssize_t(future_value_t * future_value,ssize_t value)116 future_value_set_ssize_t (future_value_t *future_value, ssize_t value)
117 {
118    future_value->type = future_value_ssize_t_type;
119    future_value->ssize_t_value = value;
120 }
121 
122 ssize_t
future_value_get_ssize_t(future_value_t * future_value)123 future_value_get_ssize_t (future_value_t *future_value)
124 {
125    BSON_ASSERT (future_value->type == future_value_ssize_t_type);
126    return future_value->ssize_t_value;
127 }
128 
129 void
future_value_set_uint32_t(future_value_t * future_value,uint32_t value)130 future_value_set_uint32_t (future_value_t *future_value, uint32_t value)
131 {
132    future_value->type = future_value_uint32_t_type;
133    future_value->uint32_t_value = value;
134 }
135 
136 uint32_t
future_value_get_uint32_t(future_value_t * future_value)137 future_value_get_uint32_t (future_value_t *future_value)
138 {
139    BSON_ASSERT (future_value->type == future_value_uint32_t_type);
140    return future_value->uint32_t_value;
141 }
142 
143 void
future_value_set_const_char_ptr(future_value_t * future_value,const_char_ptr value)144 future_value_set_const_char_ptr (future_value_t *future_value, const_char_ptr value)
145 {
146    future_value->type = future_value_const_char_ptr_type;
147    future_value->const_char_ptr_value = value;
148 }
149 
150 const_char_ptr
future_value_get_const_char_ptr(future_value_t * future_value)151 future_value_get_const_char_ptr (future_value_t *future_value)
152 {
153    BSON_ASSERT (future_value->type == future_value_const_char_ptr_type);
154    return future_value->const_char_ptr_value;
155 }
156 
157 void
future_value_set_bson_error_ptr(future_value_t * future_value,bson_error_ptr value)158 future_value_set_bson_error_ptr (future_value_t *future_value, bson_error_ptr value)
159 {
160    future_value->type = future_value_bson_error_ptr_type;
161    future_value->bson_error_ptr_value = value;
162 }
163 
164 bson_error_ptr
future_value_get_bson_error_ptr(future_value_t * future_value)165 future_value_get_bson_error_ptr (future_value_t *future_value)
166 {
167    BSON_ASSERT (future_value->type == future_value_bson_error_ptr_type);
168    return future_value->bson_error_ptr_value;
169 }
170 
171 void
future_value_set_bson_ptr(future_value_t * future_value,bson_ptr value)172 future_value_set_bson_ptr (future_value_t *future_value, bson_ptr value)
173 {
174    future_value->type = future_value_bson_ptr_type;
175    future_value->bson_ptr_value = value;
176 }
177 
178 bson_ptr
future_value_get_bson_ptr(future_value_t * future_value)179 future_value_get_bson_ptr (future_value_t *future_value)
180 {
181    BSON_ASSERT (future_value->type == future_value_bson_ptr_type);
182    return future_value->bson_ptr_value;
183 }
184 
185 void
future_value_set_const_bson_ptr(future_value_t * future_value,const_bson_ptr value)186 future_value_set_const_bson_ptr (future_value_t *future_value, const_bson_ptr value)
187 {
188    future_value->type = future_value_const_bson_ptr_type;
189    future_value->const_bson_ptr_value = value;
190 }
191 
192 const_bson_ptr
future_value_get_const_bson_ptr(future_value_t * future_value)193 future_value_get_const_bson_ptr (future_value_t *future_value)
194 {
195    BSON_ASSERT (future_value->type == future_value_const_bson_ptr_type);
196    return future_value->const_bson_ptr_value;
197 }
198 
199 void
future_value_set_const_bson_ptr_ptr(future_value_t * future_value,const_bson_ptr_ptr value)200 future_value_set_const_bson_ptr_ptr (future_value_t *future_value, const_bson_ptr_ptr value)
201 {
202    future_value->type = future_value_const_bson_ptr_ptr_type;
203    future_value->const_bson_ptr_ptr_value = value;
204 }
205 
206 const_bson_ptr_ptr
future_value_get_const_bson_ptr_ptr(future_value_t * future_value)207 future_value_get_const_bson_ptr_ptr (future_value_t *future_value)
208 {
209    BSON_ASSERT (future_value->type == future_value_const_bson_ptr_ptr_type);
210    return future_value->const_bson_ptr_ptr_value;
211 }
212 
213 void
future_value_set_mongoc_bulk_operation_ptr(future_value_t * future_value,mongoc_bulk_operation_ptr value)214 future_value_set_mongoc_bulk_operation_ptr (future_value_t *future_value, mongoc_bulk_operation_ptr value)
215 {
216    future_value->type = future_value_mongoc_bulk_operation_ptr_type;
217    future_value->mongoc_bulk_operation_ptr_value = value;
218 }
219 
220 mongoc_bulk_operation_ptr
future_value_get_mongoc_bulk_operation_ptr(future_value_t * future_value)221 future_value_get_mongoc_bulk_operation_ptr (future_value_t *future_value)
222 {
223    BSON_ASSERT (future_value->type == future_value_mongoc_bulk_operation_ptr_type);
224    return future_value->mongoc_bulk_operation_ptr_value;
225 }
226 
227 void
future_value_set_mongoc_client_ptr(future_value_t * future_value,mongoc_client_ptr value)228 future_value_set_mongoc_client_ptr (future_value_t *future_value, mongoc_client_ptr value)
229 {
230    future_value->type = future_value_mongoc_client_ptr_type;
231    future_value->mongoc_client_ptr_value = value;
232 }
233 
234 mongoc_client_ptr
future_value_get_mongoc_client_ptr(future_value_t * future_value)235 future_value_get_mongoc_client_ptr (future_value_t *future_value)
236 {
237    BSON_ASSERT (future_value->type == future_value_mongoc_client_ptr_type);
238    return future_value->mongoc_client_ptr_value;
239 }
240 
241 void
future_value_set_mongoc_collection_ptr(future_value_t * future_value,mongoc_collection_ptr value)242 future_value_set_mongoc_collection_ptr (future_value_t *future_value, mongoc_collection_ptr value)
243 {
244    future_value->type = future_value_mongoc_collection_ptr_type;
245    future_value->mongoc_collection_ptr_value = value;
246 }
247 
248 mongoc_collection_ptr
future_value_get_mongoc_collection_ptr(future_value_t * future_value)249 future_value_get_mongoc_collection_ptr (future_value_t *future_value)
250 {
251    BSON_ASSERT (future_value->type == future_value_mongoc_collection_ptr_type);
252    return future_value->mongoc_collection_ptr_value;
253 }
254 
255 void
future_value_set_mongoc_cursor_ptr(future_value_t * future_value,mongoc_cursor_ptr value)256 future_value_set_mongoc_cursor_ptr (future_value_t *future_value, mongoc_cursor_ptr value)
257 {
258    future_value->type = future_value_mongoc_cursor_ptr_type;
259    future_value->mongoc_cursor_ptr_value = value;
260 }
261 
262 mongoc_cursor_ptr
future_value_get_mongoc_cursor_ptr(future_value_t * future_value)263 future_value_get_mongoc_cursor_ptr (future_value_t *future_value)
264 {
265    BSON_ASSERT (future_value->type == future_value_mongoc_cursor_ptr_type);
266    return future_value->mongoc_cursor_ptr_value;
267 }
268 
269 void
future_value_set_mongoc_database_ptr(future_value_t * future_value,mongoc_database_ptr value)270 future_value_set_mongoc_database_ptr (future_value_t *future_value, mongoc_database_ptr value)
271 {
272    future_value->type = future_value_mongoc_database_ptr_type;
273    future_value->mongoc_database_ptr_value = value;
274 }
275 
276 mongoc_database_ptr
future_value_get_mongoc_database_ptr(future_value_t * future_value)277 future_value_get_mongoc_database_ptr (future_value_t *future_value)
278 {
279    BSON_ASSERT (future_value->type == future_value_mongoc_database_ptr_type);
280    return future_value->mongoc_database_ptr_value;
281 }
282 
283 void
future_value_set_mongoc_gridfs_file_ptr(future_value_t * future_value,mongoc_gridfs_file_ptr value)284 future_value_set_mongoc_gridfs_file_ptr (future_value_t *future_value, mongoc_gridfs_file_ptr value)
285 {
286    future_value->type = future_value_mongoc_gridfs_file_ptr_type;
287    future_value->mongoc_gridfs_file_ptr_value = value;
288 }
289 
290 mongoc_gridfs_file_ptr
future_value_get_mongoc_gridfs_file_ptr(future_value_t * future_value)291 future_value_get_mongoc_gridfs_file_ptr (future_value_t *future_value)
292 {
293    BSON_ASSERT (future_value->type == future_value_mongoc_gridfs_file_ptr_type);
294    return future_value->mongoc_gridfs_file_ptr_value;
295 }
296 
297 void
future_value_set_mongoc_gridfs_ptr(future_value_t * future_value,mongoc_gridfs_ptr value)298 future_value_set_mongoc_gridfs_ptr (future_value_t *future_value, mongoc_gridfs_ptr value)
299 {
300    future_value->type = future_value_mongoc_gridfs_ptr_type;
301    future_value->mongoc_gridfs_ptr_value = value;
302 }
303 
304 mongoc_gridfs_ptr
future_value_get_mongoc_gridfs_ptr(future_value_t * future_value)305 future_value_get_mongoc_gridfs_ptr (future_value_t *future_value)
306 {
307    BSON_ASSERT (future_value->type == future_value_mongoc_gridfs_ptr_type);
308    return future_value->mongoc_gridfs_ptr_value;
309 }
310 
311 void
future_value_set_mongoc_insert_flags_t(future_value_t * future_value,mongoc_insert_flags_t value)312 future_value_set_mongoc_insert_flags_t (future_value_t *future_value, mongoc_insert_flags_t value)
313 {
314    future_value->type = future_value_mongoc_insert_flags_t_type;
315    future_value->mongoc_insert_flags_t_value = value;
316 }
317 
318 mongoc_insert_flags_t
future_value_get_mongoc_insert_flags_t(future_value_t * future_value)319 future_value_get_mongoc_insert_flags_t (future_value_t *future_value)
320 {
321    BSON_ASSERT (future_value->type == future_value_mongoc_insert_flags_t_type);
322    return future_value->mongoc_insert_flags_t_value;
323 }
324 
325 void
future_value_set_mongoc_iovec_ptr(future_value_t * future_value,mongoc_iovec_ptr value)326 future_value_set_mongoc_iovec_ptr (future_value_t *future_value, mongoc_iovec_ptr value)
327 {
328    future_value->type = future_value_mongoc_iovec_ptr_type;
329    future_value->mongoc_iovec_ptr_value = value;
330 }
331 
332 mongoc_iovec_ptr
future_value_get_mongoc_iovec_ptr(future_value_t * future_value)333 future_value_get_mongoc_iovec_ptr (future_value_t *future_value)
334 {
335    BSON_ASSERT (future_value->type == future_value_mongoc_iovec_ptr_type);
336    return future_value->mongoc_iovec_ptr_value;
337 }
338 
339 void
future_value_set_mongoc_query_flags_t(future_value_t * future_value,mongoc_query_flags_t value)340 future_value_set_mongoc_query_flags_t (future_value_t *future_value, mongoc_query_flags_t value)
341 {
342    future_value->type = future_value_mongoc_query_flags_t_type;
343    future_value->mongoc_query_flags_t_value = value;
344 }
345 
346 mongoc_query_flags_t
future_value_get_mongoc_query_flags_t(future_value_t * future_value)347 future_value_get_mongoc_query_flags_t (future_value_t *future_value)
348 {
349    BSON_ASSERT (future_value->type == future_value_mongoc_query_flags_t_type);
350    return future_value->mongoc_query_flags_t_value;
351 }
352 
353 void
future_value_set_const_mongoc_index_opt_t(future_value_t * future_value,const_mongoc_index_opt_t value)354 future_value_set_const_mongoc_index_opt_t (future_value_t *future_value, const_mongoc_index_opt_t value)
355 {
356    future_value->type = future_value_const_mongoc_index_opt_t_type;
357    future_value->const_mongoc_index_opt_t_value = value;
358 }
359 
360 const_mongoc_index_opt_t
future_value_get_const_mongoc_index_opt_t(future_value_t * future_value)361 future_value_get_const_mongoc_index_opt_t (future_value_t *future_value)
362 {
363    BSON_ASSERT (future_value->type == future_value_const_mongoc_index_opt_t_type);
364    return future_value->const_mongoc_index_opt_t_value;
365 }
366 
367 void
future_value_set_mongoc_server_description_ptr(future_value_t * future_value,mongoc_server_description_ptr value)368 future_value_set_mongoc_server_description_ptr (future_value_t *future_value, mongoc_server_description_ptr value)
369 {
370    future_value->type = future_value_mongoc_server_description_ptr_type;
371    future_value->mongoc_server_description_ptr_value = value;
372 }
373 
374 mongoc_server_description_ptr
future_value_get_mongoc_server_description_ptr(future_value_t * future_value)375 future_value_get_mongoc_server_description_ptr (future_value_t *future_value)
376 {
377    BSON_ASSERT (future_value->type == future_value_mongoc_server_description_ptr_type);
378    return future_value->mongoc_server_description_ptr_value;
379 }
380 
381 void
future_value_set_mongoc_ss_optype_t(future_value_t * future_value,mongoc_ss_optype_t value)382 future_value_set_mongoc_ss_optype_t (future_value_t *future_value, mongoc_ss_optype_t value)
383 {
384    future_value->type = future_value_mongoc_ss_optype_t_type;
385    future_value->mongoc_ss_optype_t_value = value;
386 }
387 
388 mongoc_ss_optype_t
future_value_get_mongoc_ss_optype_t(future_value_t * future_value)389 future_value_get_mongoc_ss_optype_t (future_value_t *future_value)
390 {
391    BSON_ASSERT (future_value->type == future_value_mongoc_ss_optype_t_type);
392    return future_value->mongoc_ss_optype_t_value;
393 }
394 
395 void
future_value_set_mongoc_topology_ptr(future_value_t * future_value,mongoc_topology_ptr value)396 future_value_set_mongoc_topology_ptr (future_value_t *future_value, mongoc_topology_ptr value)
397 {
398    future_value->type = future_value_mongoc_topology_ptr_type;
399    future_value->mongoc_topology_ptr_value = value;
400 }
401 
402 mongoc_topology_ptr
future_value_get_mongoc_topology_ptr(future_value_t * future_value)403 future_value_get_mongoc_topology_ptr (future_value_t *future_value)
404 {
405    BSON_ASSERT (future_value->type == future_value_mongoc_topology_ptr_type);
406    return future_value->mongoc_topology_ptr_value;
407 }
408 
409 void
future_value_set_mongoc_write_concern_ptr(future_value_t * future_value,mongoc_write_concern_ptr value)410 future_value_set_mongoc_write_concern_ptr (future_value_t *future_value, mongoc_write_concern_ptr value)
411 {
412    future_value->type = future_value_mongoc_write_concern_ptr_type;
413    future_value->mongoc_write_concern_ptr_value = value;
414 }
415 
416 mongoc_write_concern_ptr
future_value_get_mongoc_write_concern_ptr(future_value_t * future_value)417 future_value_get_mongoc_write_concern_ptr (future_value_t *future_value)
418 {
419    BSON_ASSERT (future_value->type == future_value_mongoc_write_concern_ptr_type);
420    return future_value->mongoc_write_concern_ptr_value;
421 }
422 
423 void
future_value_set_const_mongoc_find_and_modify_opts_ptr(future_value_t * future_value,const_mongoc_find_and_modify_opts_ptr value)424 future_value_set_const_mongoc_find_and_modify_opts_ptr (future_value_t *future_value, const_mongoc_find_and_modify_opts_ptr value)
425 {
426    future_value->type = future_value_const_mongoc_find_and_modify_opts_ptr_type;
427    future_value->const_mongoc_find_and_modify_opts_ptr_value = value;
428 }
429 
430 const_mongoc_find_and_modify_opts_ptr
future_value_get_const_mongoc_find_and_modify_opts_ptr(future_value_t * future_value)431 future_value_get_const_mongoc_find_and_modify_opts_ptr (future_value_t *future_value)
432 {
433    BSON_ASSERT (future_value->type == future_value_const_mongoc_find_and_modify_opts_ptr_type);
434    return future_value->const_mongoc_find_and_modify_opts_ptr_value;
435 }
436 
437 void
future_value_set_const_mongoc_iovec_ptr(future_value_t * future_value,const_mongoc_iovec_ptr value)438 future_value_set_const_mongoc_iovec_ptr (future_value_t *future_value, const_mongoc_iovec_ptr value)
439 {
440    future_value->type = future_value_const_mongoc_iovec_ptr_type;
441    future_value->const_mongoc_iovec_ptr_value = value;
442 }
443 
444 const_mongoc_iovec_ptr
future_value_get_const_mongoc_iovec_ptr(future_value_t * future_value)445 future_value_get_const_mongoc_iovec_ptr (future_value_t *future_value)
446 {
447    BSON_ASSERT (future_value->type == future_value_const_mongoc_iovec_ptr_type);
448    return future_value->const_mongoc_iovec_ptr_value;
449 }
450 
451 void
future_value_set_const_mongoc_read_prefs_ptr(future_value_t * future_value,const_mongoc_read_prefs_ptr value)452 future_value_set_const_mongoc_read_prefs_ptr (future_value_t *future_value, const_mongoc_read_prefs_ptr value)
453 {
454    future_value->type = future_value_const_mongoc_read_prefs_ptr_type;
455    future_value->const_mongoc_read_prefs_ptr_value = value;
456 }
457 
458 const_mongoc_read_prefs_ptr
future_value_get_const_mongoc_read_prefs_ptr(future_value_t * future_value)459 future_value_get_const_mongoc_read_prefs_ptr (future_value_t *future_value)
460 {
461    BSON_ASSERT (future_value->type == future_value_const_mongoc_read_prefs_ptr_type);
462    return future_value->const_mongoc_read_prefs_ptr_value;
463 }
464 
465 void
future_value_set_const_mongoc_write_concern_ptr(future_value_t * future_value,const_mongoc_write_concern_ptr value)466 future_value_set_const_mongoc_write_concern_ptr (future_value_t *future_value, const_mongoc_write_concern_ptr value)
467 {
468    future_value->type = future_value_const_mongoc_write_concern_ptr_type;
469    future_value->const_mongoc_write_concern_ptr_value = value;
470 }
471 
472 const_mongoc_write_concern_ptr
future_value_get_const_mongoc_write_concern_ptr(future_value_t * future_value)473 future_value_get_const_mongoc_write_concern_ptr (future_value_t *future_value)
474 {
475    BSON_ASSERT (future_value->type == future_value_const_mongoc_write_concern_ptr_type);
476    return future_value->const_mongoc_write_concern_ptr_value;
477 }
478