Loading...
Searching...
No Matches
aerospike
as_cdt_order.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008-2024 Aerospike, Inc.
3
*
4
* Portions may be licensed to Aerospike, Inc. under one or more contributor
5
* license agreements.
6
*
7
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
8
* use this file except in compliance with the License. You may obtain a copy of
9
* the License at http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
* License for the specific language governing permissions and limitations under
15
* the License.
16
*/
17
#pragma once
18
19
#include <
aerospike/as_std.h
>
20
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
/******************************************************************************
26
* TYPES
27
*****************************************************************************/
28
29
/**
30
* List storage order.
31
*
32
* @ingroup list_operations
33
*/
34
typedef
enum
as_list_order_e {
35
/**
36
* List is not ordered. This is the default.
37
*/
38
AS_LIST_UNORDERED
= 0,
39
40
/**
41
* List is ordered.
42
*/
43
AS_LIST_ORDERED
= 1
44
}
as_list_order
;
45
46
/**
47
* Map storage order.
48
*
49
* @ingroup map_operations
50
*/
51
typedef
enum
as_map_order_e {
52
/**
53
* Map is not ordered. This is the default.
54
*/
55
AS_MAP_UNORDERED
= 0,
56
57
/**
58
* Order map by key.
59
*/
60
AS_MAP_KEY_ORDERED
= 1,
61
62
/**
63
* Order map by key, then value.
64
*/
65
AS_MAP_KEY_VALUE_ORDERED
= 3
66
}
as_map_order
;
67
68
/******************************************************************************
69
* FUNCTIONS
70
*****************************************************************************/
71
72
static
inline
uint32_t
73
as_list_order_to_flag
(
as_list_order
order,
bool
pad)
74
{
75
return
(order ==
AS_LIST_ORDERED
)? 0xc0 : pad ? 0x80 : 0x40;
76
}
77
78
static
inline
uint32_t
79
as_map_order_to_flag
(
as_map_order
order)
80
{
81
switch
(order) {
82
default
:
83
case
AS_MAP_UNORDERED
:
84
return
0x40;
85
86
case
AS_MAP_KEY_ORDERED
:
87
return
0x80;
88
89
case
AS_MAP_KEY_VALUE_ORDERED
:
90
return
0xc0;
91
}
92
}
93
94
#ifdef __cplusplus
95
}
// end extern "C"
96
#endif
as_map_order_to_flag
static uint32_t as_map_order_to_flag(as_map_order order)
Definition
as_cdt_order.h:79
as_list_order_to_flag
static uint32_t as_list_order_to_flag(as_list_order order, bool pad)
Definition
as_cdt_order.h:73
as_std.h
as_list_order
as_list_order
Definition
as_cdt_order.h:34
AS_LIST_ORDERED
@ AS_LIST_ORDERED
Definition
as_cdt_order.h:43
AS_LIST_UNORDERED
@ AS_LIST_UNORDERED
Definition
as_cdt_order.h:38
as_map_order
as_map_order
Definition
as_cdt_order.h:51
AS_MAP_KEY_ORDERED
@ AS_MAP_KEY_ORDERED
Definition
as_cdt_order.h:60
AS_MAP_KEY_VALUE_ORDERED
@ AS_MAP_KEY_VALUE_ORDERED
Definition
as_cdt_order.h:65
AS_MAP_UNORDERED
@ AS_MAP_UNORDERED
Definition
as_cdt_order.h:55