28#ifndef DBUS_POLLABLE_SET_H
29#define DBUS_POLLABLE_SET_H
31#ifndef DOXYGEN_SHOULD_SKIP_THIS
34#include <dbus/dbus-sysdeps.h>
41typedef struct DBusPollableSet DBusPollableSet;
43typedef struct DBusPollableSetClass DBusPollableSetClass;
44struct DBusPollableSetClass {
45 void (*free) (DBusPollableSet *self);
46 dbus_bool_t (*add) (DBusPollableSet *self,
50 void (*remove) (DBusPollableSet *self,
52 void (*enable) (DBusPollableSet *self,
55 void (*disable) (DBusPollableSet *self,
57 int (*poll) (DBusPollableSet *self,
58 DBusPollableEvent *revents,
63struct DBusPollableSet {
64 DBusPollableSetClass *cls;
67DBusPollableSet *_dbus_pollable_set_new (
int size_hint);
70_dbus_pollable_set_free (DBusPollableSet *self)
72 (self->cls->free) (self);
75static inline dbus_bool_t
76_dbus_pollable_set_add (DBusPollableSet *self,
81 return (self->cls->add) (self, fd, flags, enabled);
85_dbus_pollable_set_remove (DBusPollableSet *self,
88 (self->cls->remove) (self, fd);
92_dbus_pollable_set_enable (DBusPollableSet *self,
96 (self->cls->enable) (self, fd, flags);
100_dbus_pollable_set_disable (DBusPollableSet *self,
103 (self->cls->disable) (self, fd);
108_dbus_pollable_set_poll (DBusPollableSet *self,
109 DBusPollableEvent *revents,
113 return (self->cls->poll) (self, revents, max_events, timeout_ms);
118extern DBusPollableSetClass _dbus_pollable_set_poll_class;
119extern DBusPollableSetClass _dbus_pollable_set_epoll_class;
121DBusPollableSet *_dbus_pollable_set_poll_new (
int size_hint);
122DBusPollableSet *_dbus_pollable_set_epoll_new (
void);