20 #ifndef MPD_EVENT_POLLGROUP_WINSELECT_HXX 21 #define MPD_EVENT_POLLGROUP_WINSELECT_HXX 30 #include <unordered_map> 45 set.fd_count = other.set.fd_count;
48 sizeof (SOCKET) *
set.fd_count);
52 int Size() {
return set.fd_count; }
53 bool IsEmpty() {
return set.fd_count == 0; }
54 bool IsFull() {
return set.fd_count == FD_SETSIZE; }
57 assert(index >= 0 && (u_int)index <
set.fd_count);
58 return set.fd_array[index];
63 set.fd_array[
set.fd_count] = fd;
64 return set.fd_count++;
68 assert(index >= 0 && (u_int)index <
set.fd_count);
69 std::swap(
set.fd_array[index],
set.fd_array[
set.fd_count - 1]);
88 std::unordered_map<int, Item> items;
90 bool CanModify(Item &item,
unsigned events,
int event_id);
91 void Modify(Item &item,
int fd,
unsigned events,
int event_id);
96 static constexpr
unsigned READ = 1;
97 static constexpr
unsigned WRITE = 2;
98 static constexpr
unsigned ERROR = 0;
99 static constexpr
unsigned HANGUP = 0;
105 bool Add(
int fd,
unsigned events,
void *obj);
106 bool Modify(
int fd,
unsigned events,
void *obj);
static constexpr unsigned HANGUP
int operator[](int index)
void ReadEvents(PollResultGeneric &result, int timeout_ms)
static constexpr unsigned WRITE
SocketSet(SocketSet &other)
bool Add(int fd, unsigned events, void *obj)
void MoveToEnd(int index)
static constexpr unsigned ERROR
static constexpr unsigned READ