transport_impl.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_LIB_TRANSPORT_TRANSPORT_IMPL_H
20 #define GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H
21 
23 
24 #include <stddef.h>
25 
26 #include "absl/strings/string_view.h"
27 
36 
37 typedef struct grpc_transport_vtable {
38  /* Memory required for a single stream element - this is allocated by upper
39  layers and initialized by the transport */
40  size_t sizeof_stream; /* = sizeof(transport stream) */
41 
42  /* name of this transport implementation */
43  const char* name;
44 
45  /* implementation of grpc_transport_init_stream */
47  grpc_stream_refcount* refcount, const void* server_data,
49 
50  /* Create a promise to execute one client call.
51  If this is non-null, it may be used in preference to
52  perform_stream_op.
53  If this is used in preference to perform_stream_op, the
54  following can be omitted also:
55  - calling init_stream, destroy_stream, set_pollset, set_pollset_set
56  - allocation of memory for call data (sizeof_stream may be ignored)
57  There is an on-going migration to move all filters to providing this, and
58  then to drop perform_stream_op. */
60  grpc_transport* self, grpc_core::ClientMetadataHandle initial_metadata);
61 
62  /* implementation of grpc_transport_set_pollset */
64  grpc_pollset* pollset);
65 
66  /* implementation of grpc_transport_set_pollset */
68  grpc_pollset_set* pollset_set);
69 
70  /* implementation of grpc_transport_perform_stream_op */
73 
74  /* implementation of grpc_transport_perform_op */
76 
77  /* implementation of grpc_transport_destroy_stream */
79  grpc_closure* then_schedule_closure);
80 
81  /* implementation of grpc_transport_destroy */
82  void (*destroy)(grpc_transport* self);
83 
84  /* implementation of grpc_transport_get_endpoint */
85  grpc_endpoint* (*get_endpoint)(grpc_transport* self);
87 
88 /* an instance of a grpc transport */
92  /* pointer to a vtable defining operations on this transport */
94 };
95 
96 #endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */
pollset.h
grpc_transport_vtable::perform_op
void(* perform_op)(grpc_transport *self, grpc_transport_op *op)
Definition: transport_impl.h:75
grpc_transport_vtable
Definition: transport_impl.h:37
grpc_transport::ChannelArgName
static absl::string_view ChannelArgName()
Definition: transport_impl.h:91
grpc_pollset_set
struct grpc_pollset_set grpc_pollset_set
Definition: iomgr_fwd.h:23
absl::string_view
Definition: abseil-cpp/absl/strings/string_view.h:167
grpc_transport_vtable::set_pollset
void(* set_pollset)(grpc_transport *self, grpc_stream *stream, grpc_pollset *pollset)
Definition: transport_impl.h:63
arena.h
closure.h
grpc_transport_vtable
struct grpc_transport_vtable grpc_transport_vtable
grpc_transport_vtable::set_pollset_set
void(* set_pollset_set)(grpc_transport *self, grpc_stream *stream, grpc_pollset_set *pollset_set)
Definition: transport_impl.h:67
grpc_transport_vtable::perform_stream_op
void(* perform_stream_op)(grpc_transport *self, grpc_stream *stream, grpc_transport_stream_op_batch *op)
Definition: transport_impl.h:71
grpc_core::Arena
Definition: src/core/lib/resource_quota/arena.h:45
grpc_transport_op
Definition: transport.h:452
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
refcount
size_t refcount
Definition: abseil-cpp/absl/strings/internal/cordz_info.cc:122
grpc_transport_vtable::make_call_promise
grpc_core::ArenaPromise< grpc_core::ServerMetadataHandle >(* make_call_promise)(grpc_transport *self, grpc_core::ClientMetadataHandle initial_metadata)
Definition: transport_impl.h:59
xds_interop_client.int
int
Definition: xds_interop_client.py:113
grpc_transport_vtable::sizeof_stream
size_t sizeof_stream
Definition: transport_impl.h:40
arena_promise.h
transport_fwd.h
grpc_transport_vtable::destroy_stream
void(* destroy_stream)(grpc_transport *self, grpc_stream *stream, grpc_closure *then_schedule_closure)
Definition: transport_impl.h:78
grpc_core::MetadataHandle< ClientMetadata >
grpc_transport_vtable::init_stream
int(* init_stream)(grpc_transport *self, grpc_stream *stream, grpc_stream_refcount *refcount, const void *server_data, grpc_core::Arena *arena)
Definition: transport_impl.h:46
grpc_core::ArenaPromise
Definition: arena_promise.h:152
grpc_transport::vtable
const grpc_transport_vtable * vtable
Definition: transport_impl.h:93
grpc_transport
Definition: transport_impl.h:89
transport.h
grpc_stream
struct grpc_stream grpc_stream
Definition: transport.h:174
grpc_transport::RawPointerChannelArgTag
Definition: transport_impl.h:90
iomgr_fwd.h
endpoint.h
grpc_transport_vtable::name
const char * name
Definition: transport_impl.h:43
grpc_pollset
Definition: bm_cq_multiple_threads.cc:37
grpc_transport_stream_op_batch
Definition: transport.h:284
grpc_transport_vtable::destroy
void(* destroy)(grpc_transport *self)
Definition: transport_impl.h:82
grpc_closure
Definition: closure.h:56
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
grpc_endpoint
Definition: endpoint.h:105
grpc_stream_refcount
Definition: transport.h:178
GRPC_ARG_TRANSPORT
#define GRPC_ARG_TRANSPORT
Definition: transport.h:71
port_platform.h
stream
voidpf stream
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136


grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:40