GRPC Core  18.0.0
polling_entity.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_IOMGR_POLLING_ENTITY_H
20 #define GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H
21 
23 
26 
27 typedef enum grpc_pollset_tag {
32 
33 /* A grpc_polling_entity is a pollset-or-pollset_set container. It allows
34  * functions that accept a pollset XOR a pollset_set to do so through an
35  * abstract interface. No ownership is taken. */
36 
38  union {
39  grpc_pollset* pollset = nullptr;
43 };
44 
46  grpc_pollset_set* pollset_set);
48  grpc_pollset* pollset);
49 
52 
55 
57 
61  grpc_pollset_set* pss_dst);
62 
66  grpc_pollset_set* pss_dst);
67 
68 #endif /* GRPC_CORE_LIB_IOMGR_POLLING_ENTITY_H */
grpc_pollset_set * grpc_polling_entity_pollset_set(grpc_polling_entity *pollent)
If pollent contains a pollset_set, return it.
Definition: polling_entity.cc:49
grpc_pollset_tag
Definition: polling_entity.h:27
@ GRPC_POLLS_POLLSET
Definition: polling_entity.h:29
@ GRPC_POLLS_POLLSET_SET
Definition: polling_entity.h:30
@ GRPC_POLLS_NONE
Definition: polling_entity.h:28
void grpc_polling_entity_add_to_pollset_set(grpc_polling_entity *pollent, grpc_pollset_set *pss_dst)
Add the pollset or pollset_set in pollent to the destination pollset_set * pss_dst.
Definition: polling_entity.cc:61
grpc_polling_entity grpc_polling_entity_create_from_pollset(grpc_pollset *pollset)
Definition: polling_entity.cc:34
bool grpc_polling_entity_is_empty(const grpc_polling_entity *pollent)
Definition: polling_entity.cc:57
grpc_pollset * grpc_polling_entity_pollset(grpc_polling_entity *pollent)
If pollent contains a pollset, return it.
Definition: polling_entity.cc:42
grpc_polling_entity grpc_polling_entity_create_from_pollset_set(grpc_pollset_set *pollset_set)
Definition: polling_entity.cc:26
void grpc_polling_entity_del_from_pollset_set(grpc_polling_entity *pollent, grpc_pollset_set *pss_dst)
Delete the pollset or pollset_set in pollent from the destination pollset_set * pss_dst.
Definition: polling_entity.cc:78
struct grpc_pollset_set grpc_pollset_set
Definition: pollset_set.h:31
Definition: polling_entity.h:37
grpc_pollset * pollset
Definition: polling_entity.h:39
grpc_pollset_tag tag
Definition: polling_entity.h:42
grpc_pollset_set * pollset_set
Definition: polling_entity.h:40
union grpc_polling_entity::@19 pollent
Definition: pollset_custom.cc:40