GRPC Core  9.0.0
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 
25 
26 typedef struct grpc_transport_vtable {
27  /* Memory required for a single stream element - this is allocated by upper
28  layers and initialized by the transport */
29  size_t sizeof_stream; /* = sizeof(transport stream) */
30 
31  /* name of this transport implementation */
32  const char* name;
33 
34  /* implementation of grpc_transport_init_stream */
35  int (*init_stream)(grpc_transport* self, grpc_stream* stream,
36  grpc_stream_refcount* refcount, const void* server_data,
37  grpc_core::Arena* arena);
38 
39  /* implementation of grpc_transport_set_pollset */
40  void (*set_pollset)(grpc_transport* self, grpc_stream* stream,
41  grpc_pollset* pollset);
42 
43  /* implementation of grpc_transport_set_pollset */
44  void (*set_pollset_set)(grpc_transport* self, grpc_stream* stream,
45  grpc_pollset_set* pollset_set);
46 
47  /* implementation of grpc_transport_perform_stream_op */
50 
51  /* implementation of grpc_transport_perform_op */
53 
54  /* implementation of grpc_transport_destroy_stream */
55  void (*destroy_stream)(grpc_transport* self, grpc_stream* stream,
56  grpc_closure* then_schedule_closure);
57 
58  /* implementation of grpc_transport_destroy */
59  void (*destroy)(grpc_transport* self);
60 
61  /* implementation of grpc_transport_get_endpoint */
62  grpc_endpoint* (*get_endpoint)(grpc_transport* self);
64 
65 /* an instance of a grpc transport */
67  /* pointer to a vtable defining operations on this transport */
69 };
70 
71 #endif /* GRPC_CORE_LIB_TRANSPORT_TRANSPORT_IMPL_H */
Definition: arena.h:44
void(* destroy_stream)(grpc_transport *self, grpc_stream *stream, grpc_closure *then_schedule_closure)
Definition: transport_impl.h:55
struct grpc_stream grpc_stream
Definition: transport.h:52
Definition: transport.h:56
void(* perform_stream_op)(grpc_transport *self, grpc_stream *stream, grpc_transport_stream_op_batch *op)
Definition: transport_impl.h:48
Definition: pollset_custom.cc:40
Definition: transport.h:163
const char * name
Definition: transport_impl.h:32
struct grpc_pollset_set grpc_pollset_set
Definition: pollset_set.h:31
Definition: transport_impl.h:26
const grpc_transport_vtable * vtable
Definition: transport_impl.h:68
void(* set_pollset_set)(grpc_transport *self, grpc_stream *stream, grpc_pollset_set *pollset_set)
Definition: transport_impl.h:44
A closure over a grpc_iomgr_cb_func.
Definition: closure.h:56
size_t sizeof_stream
Definition: transport_impl.h:29
Definition: endpoint.h:102
void(* perform_op)(grpc_transport *self, grpc_transport_op *op)
Definition: transport_impl.h:52
void(* destroy)(grpc_transport *self)
Definition: transport_impl.h:59
Definition: transport_impl.h:66
void(* set_pollset)(grpc_transport *self, grpc_stream *stream, grpc_pollset *pollset)
Definition: transport_impl.h:40
Transport op: a set of operations to perform on a transport as a whole.
Definition: transport.h:324
struct grpc_transport_vtable grpc_transport_vtable
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:35