21 #ifndef COMMON_IO_SELECTPOLLER_H_
22 #define COMMON_IO_SELECTPOLLER_H_
24 #include <ola/Clock.h>
27 #include <ola/io/Descriptor.h>
31 #include "common/io/PollerInterface.h"
32 #include "common/io/TimeoutManager.h"
54 bool delete_on_close);
61 const TimeStamp *WakeUpTime()
const {
return &m_wake_up_time; }
70 } connected_descriptor_t;
72 struct connected_descriptor_t_lt {
73 bool operator()(
const connected_descriptor_t &c1,
74 const connected_descriptor_t &c2)
const {
75 return c1.descriptor->ReadDescriptor() <
76 c2.descriptor->ReadDescriptor();
80 typedef std::set<ReadFileDescriptor*> ReadDescriptorSet;
81 typedef std::set<WriteFileDescriptor*> WriteDescriptorSet;
82 typedef std::set<connected_descriptor_t, connected_descriptor_t_lt>
83 ConnectedDescriptorSet;
91 ReadDescriptorSet m_read_descriptors;
92 ConnectedDescriptorSet m_connected_read_descriptors;
93 WriteDescriptorSet m_write_descriptors;
95 void CheckDescriptors(fd_set *r_set, fd_set *w_set);
96 bool AddDescriptorsToSet(fd_set *r_set, fd_set *w_set,
int *max_sd);
102 #endif // COMMON_IO_SELECTPOLLER_H_