All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_cdt_order.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2020 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  */
39 
40  /**
41  * List is ordered.
42  */
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  */
56 
57  /**
58  * Order map by key.
59  */
61 
62  /**
63  * Order map by key, then value.
64  */
66 } as_map_order;
67 
68 /******************************************************************************
69  * FUNCTIONS
70  *****************************************************************************/
71 
72 static inline uint32_t
74 {
75  return (order == AS_LIST_ORDERED)? 0xc0 : pad ? 0x80 : 0x40;
76 }
77 
78 static inline uint32_t
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 
90  return 0xc0;
91  }
92 }
93 
94 #ifdef __cplusplus
95 } // end extern "C"
96 #endif
as_list_order
Definition: as_cdt_order.h:34
static uint32_t as_list_order_to_flag(as_list_order order, bool pad)
Definition: as_cdt_order.h:73
as_map_order
Definition: as_cdt_order.h:51
static uint32_t as_map_order_to_flag(as_map_order order)
Definition: as_cdt_order.h:79