Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
u
v
w
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
z
Classes
Class List
Class Hierarchy
Class Members
All
:
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
[
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
y
Enumerations
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Properties
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
grpc
src
core
ext
transport
chttp2
transport
stream_map.h
Go to the documentation of this file.
1
/*
2
*
3
* Copyright 2015 gRPC authors.
4
*
5
* Licensed under the Apache License, Version 2.0 (the "License");
6
* you may not use this file except in compliance with the License.
7
* You may obtain a copy of the License at
8
*
9
* 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,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*
17
*/
18
19
#ifndef GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H
20
#define GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H
21
22
#include <
grpc/support/port_platform.h
>
23
24
#include <stddef.h>
25
#include <
stdint.h
>
26
27
/* Data structure to map a uint32_t to a data object (represented by a void*)
28
29
Represented as a sorted array of keys, and a corresponding array of values.
30
Lookups are performed with binary search.
31
Adds are restricted to strictly higher keys than previously seen (this is
32
guaranteed by http2). */
33
struct
grpc_chttp2_stream_map
{
34
uint32_t
*
keys
;
35
void
**
values
;
36
size_t
count
;
37
size_t
free
;
38
size_t
capacity
;
39
};
40
void
grpc_chttp2_stream_map_init
(
grpc_chttp2_stream_map
*
map
,
41
size_t
initial_capacity);
42
void
grpc_chttp2_stream_map_destroy
(
grpc_chttp2_stream_map
*
map
);
43
44
/* Add a new key: given http2 semantics, new keys must always be greater than
45
existing keys - this is asserted */
46
void
grpc_chttp2_stream_map_add
(
grpc_chttp2_stream_map
*
map
,
uint32_t
key
,
47
void
*
value
);
48
49
/* Delete an existing key - returns the previous value of the key if it existed,
50
or NULL otherwise */
51
void
*
grpc_chttp2_stream_map_delete
(
grpc_chttp2_stream_map
*
map
,
uint32_t
key
);
52
53
/* Return an existing key, or NULL if it does not exist */
54
void
*
grpc_chttp2_stream_map_find
(
grpc_chttp2_stream_map
*
map
,
uint32_t
key
);
55
56
/* Return a random entry */
57
void
*
grpc_chttp2_stream_map_rand
(
grpc_chttp2_stream_map
*
map
);
58
59
/* How many (populated) entries are in the stream map? */
60
size_t
grpc_chttp2_stream_map_size
(
grpc_chttp2_stream_map
*
map
);
61
62
/* Callback on each stream */
63
void
grpc_chttp2_stream_map_for_each
(
grpc_chttp2_stream_map
*
map
,
64
void
(*
f
)(
void
* user_data,
uint32_t
key
,
65
void
*
value
),
66
void
* user_data);
67
68
#endif
/* GRPC_CORE_EXT_TRANSPORT_CHTTP2_TRANSPORT_STREAM_MAP_H */
grpc_chttp2_stream_map_destroy
void grpc_chttp2_stream_map_destroy(grpc_chttp2_stream_map *map)
Definition:
stream_map.cc:40
grpc_chttp2_stream_map_add
void grpc_chttp2_stream_map_add(grpc_chttp2_stream_map *map, uint32_t key, void *value)
Definition:
stream_map.cc:59
grpc_chttp2_stream_map::values
void ** values
Definition:
stream_map.h:35
map
zval * map
Definition:
php/ext/google/protobuf/encode_decode.c:480
grpc_chttp2_stream_map::count
size_t count
Definition:
stream_map.h:36
uint32_t
unsigned int uint32_t
Definition:
stdint-msvc2008.h:80
grpc_chttp2_stream_map_rand
void * grpc_chttp2_stream_map_rand(grpc_chttp2_stream_map *map)
Definition:
stream_map.cc:154
autogen_x86imm.f
f
Definition:
autogen_x86imm.py:9
grpc_chttp2_stream_map_delete
void * grpc_chttp2_stream_map_delete(grpc_chttp2_stream_map *map, uint32_t key)
Definition:
stream_map.cc:129
stdint.h
grpc_chttp2_stream_map::free
size_t free
Definition:
stream_map.h:37
grpc_chttp2_stream_map
Definition:
stream_map.h:33
grpc_chttp2_stream_map_find
void * grpc_chttp2_stream_map_find(grpc_chttp2_stream_map *map, uint32_t key)
Definition:
stream_map.cc:145
value
const char * value
Definition:
hpack_parser_table.cc:165
grpc_chttp2_stream_map::keys
uint32_t * keys
Definition:
stream_map.h:34
key
const char * key
Definition:
hpack_parser_table.cc:164
grpc_chttp2_stream_map_init
void grpc_chttp2_stream_map_init(grpc_chttp2_stream_map *map, size_t initial_capacity)
Definition:
stream_map.cc:28
grpc_chttp2_stream_map_for_each
void grpc_chttp2_stream_map_for_each(grpc_chttp2_stream_map *map, void(*f)(void *user_data, uint32_t key, void *value), void *user_data)
Definition:
stream_map.cc:166
grpc_chttp2_stream_map_size
size_t grpc_chttp2_stream_map_size(grpc_chttp2_stream_map *map)
Definition:
stream_map.cc:150
grpc_chttp2_stream_map::capacity
size_t capacity
Definition:
stream_map.h:38
port_platform.h
grpc
Author(s):
autogenerated on Thu Mar 13 2025 03:01:25