proxygen
Event.h
Go to the documentation of this file.
1 /*
2  * Copyright 2016-present Facebook, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #ifdef _MSC_VER
20 // This needs to be before the libevent include.
22 #endif
23 
24 #include <event.h>
25 
26 #ifdef _MSC_VER
27 #include <event2/event_compat.h> // @manual
29 #endif
30 
32 
33 namespace folly {
34 #ifdef _MSC_VER
35 using libevent_fd_t = evutil_socket_t;
36 #else
37 using libevent_fd_t = int;
38 #endif
39 
40 inline libevent_fd_t getLibeventFd(int fd) {
42 }
43 
44 inline int libeventFdToFd(libevent_fd_t fd) {
46 }
47 
48 using EventSetCallback = void (*)(libevent_fd_t, short, void*);
49 inline void
50 folly_event_set(event* e, int fd, short s, EventSetCallback f, void* arg) {
51  auto lfd = getLibeventFd(fd);
52  event_set(e, lfd, s, f, arg);
53 }
54 } // namespace folly
auto f
—— Concurrent Priority Queue Implementation ——
Definition: AtomicBitSet.h:29
void(*)(libevent_fd_t, short, void *) EventSetCallback
Definition: Event.h:48
void folly_event_set(event *e, int fd, short s, EventSetCallback f, void *arg)
Definition: Event.h:50
libevent_fd_t getLibeventFd(int fd)
Definition: Event.h:40
static set< string > s
int libeventFdToFd(libevent_fd_t fd)
Definition: Event.h:44
int libevent_fd_t
Definition: Event.h:37