randolf.ca  1.00
Randolf Richardson's C++ classes
Loading...
Searching...
No Matches
rsocket_mux_fds
1#pragma once
2
3#include <randolf/rsocket>
4
5namespace randolf {
6
7 /*======================================================================*//**
8 @brief
9 Internal structure that @ref rsocket_mux uses to store @ref rsocket objects
10 with their intended fds/fd_set relations. The vector that this structure is
11 used to generate fds tables.
12 @see rsocket_mux
13 *///=========================================================================
14 struct rsocket_mux_fds {
15 /// Pointer to instantiated rsocket object
16 rsocket* r;
17 /// Flags for intended fd_set array relations (e.g., @c POLLIN, @c POLLOUT, @c POLLERR, etc.)
18 int fd_sets;
19
20 /*======================================================================*//**
21 @brief
22 Built-in comparison operator used by @c std::set for ordering rsocket objects
23 by their underlying socket descriptors because this is what is needed for
24 internal muxing by POSIX's @c select(), @c poll(), etc. functions.
25 @returns Underlying socket handle
26 *///=========================================================================
27 bool operator<(/// This rsocket_mux_fds structure
28 const rsocket_mux_fds& rmf) const {
29 return r->socket_fd() < rmf.r->socket_fd();
30 }; // -x- bool < -x-
31
32 }; // -x- struct rsocket_mux_fds -x-
33
34}; // -x- namespace randolf -x-