maph 1.0.0 High-Performance Memory-Mapped Key-Value Database with O(1) Lookups

Loading...
Searching...
No Matches
asio.h
Go to the documentation of this file.
1/*
2 * Authored by Alex Hultman, 2018-2021.
3 * Intellectual property of third-party.
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#ifndef ASIO_H
19#define ASIO_H
20
21#include "internal/loop_data.h"
22
23#define LIBUS_SOCKET_READABLE 1
24#define LIBUS_SOCKET_WRITABLE 2
25
26 struct us_loop_t {
27 alignas(LIBUS_EXT_ALIGNMENT) struct us_internal_loop_data_t data;
28
29 // a loop is an io_context
30 void *io;
31
32 // whether or not we got an io_context as hint or not
33 int is_default;
34};
35
36// it is no longer valid to cast a pointer to us_poll_t to a pointer of uv_poll_t
37 struct us_poll_t {
38 void *boost_block;
39
40 LIBUS_SOCKET_DESCRIPTOR fd;
41 unsigned char poll_type;
42 int events;
43};
44
45#endif // ASIO_H
LIBUS_SOCKET_DESCRIPTOR
#define LIBUS_SOCKET_DESCRIPTOR
Definition libusockets.h:38
LIBUS_EXT_ALIGNMENT
#define LIBUS_EXT_ALIGNMENT
Definition libusockets.h:28
us_poll_t::fd
LIBUS_SOCKET_DESCRIPTOR fd
Definition asio.h:40
us_poll_t::events
int events
Definition asio.h:42
us_loop_t::data
struct us_internal_loop_data_t data
Definition asio.h:27
us_poll_t::poll_type
unsigned char poll_type
Definition asio.h:41
us_loop_t::io
void * io
Definition asio.h:30
us_loop_t::is_default
int is_default
Definition asio.h:33
us_poll_t::boost_block
void * boost_block
Definition asio.h:38
us_poll_t
Definition asio.h:37
us_loop_t
Definition asio.h:26
loop_data.h
us_internal_loop_data_t
Definition loop_data.h:21