All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
as_hashmap.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 
18 /******************************************************************************
19  *
20  * as_hashmap is DEPRECATED!
21  *
22  * Please switch to as_orderedmap where the base class as_map cannot be used.
23  * as_hashmap will be removed in 2023.
24  *
25  ******************************************************************************/
26 
27 #pragma once
28 
29 #include <aerospike/as_map.h>
31 #include <aerospike/as_std.h>
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /******************************************************************************
38  * TYPES
39  ******************************************************************************/
40 
41 #define as_hashmap as_orderedmap
42 
43 /*******************************************************************************
44  * INSTANCE FUNCTIONS
45  ******************************************************************************/
46 
47 static inline as_hashmap*
48 as_hashmap_init(as_hashmap* map, uint32_t capacity)
49 {
50  map = as_orderedmap_init(map, capacity);
51 
52  if (map == NULL) {
53  return NULL;
54  }
55 
57 
58  return map;
59 }
60 
61 static inline as_hashmap*
62 as_hashmap_new(uint32_t capacity)
63 {
64  as_orderedmap* map = as_orderedmap_new(capacity);
65 
66  if (map == NULL) {
67  return NULL;
68  }
69 
71 
72  return map;
73 }
74 
75 #define as_hashmap_destroy as_orderedmap_destroy
76 
77 /*******************************************************************************
78  * INFO FUNCTIONS
79  ******************************************************************************/
80 
81 #define as_hashmap_size as_orderedmap_size
82 
83 static inline uint32_t
85 {
86  return 1;
87 }
88 
89 /*******************************************************************************
90  * ACCESSOR AND MODIFIER FUNCTIONS
91  ******************************************************************************/
92 
93 #define as_hashmap_get as_orderedmap_get
94 #define as_hashmap_set as_orderedmap_set
95 #define as_hashmap_clear as_orderedmap_clear
96 #define as_hashmap_remove as_orderedmap_remove
97 #define as_hashmap_set_flags as_orderedmap_set_flags
98 
99 /******************************************************************************
100  * ITERATION FUNCTIONS
101  *****************************************************************************/
102 
103 #define as_hashmap_foreach as_orderedmap_foreach
104 
105 #ifdef __cplusplus
106 } // end extern "C"
107 #endif
static as_hashmap * as_hashmap_init(as_hashmap *map, uint32_t capacity)
Definition: as_hashmap.h:48
#define as_hashmap
Definition: as_hashmap.h:41
static as_hashmap * as_hashmap_new(uint32_t capacity)
Definition: as_hashmap.h:62
AS_EXTERN as_orderedmap * as_orderedmap_init(as_orderedmap *map, uint32_t capacity)
static void as_orderedmap_set_flags(as_orderedmap *map, uint32_t flags)
static uint32_t as_hashmap_hashcode(const as_hashmap *map)
Definition: as_hashmap.h:84
AS_EXTERN as_orderedmap * as_orderedmap_new(uint32_t capacity)