21 #ifndef COMMON_IO_SELECTPOLLER_H_ 22 #define COMMON_IO_SELECTPOLLER_H_ 24 #include <ola/Clock.h> 32 #include "common/io/PollerInterface.h" 33 #include "common/io/TimeoutManager.h" 56 bool delete_on_close);
63 const TimeStamp *WakeUpTime()
const {
return &m_wake_up_time; }
72 } connected_descriptor_t;
74 typedef std::map<int, ReadFileDescriptor*> ReadDescriptorMap;
75 typedef std::map<int, WriteFileDescriptor*> WriteDescriptorMap;
76 typedef std::map<int, connected_descriptor_t*> ConnectedDescriptorMap;
84 ReadDescriptorMap m_read_descriptors;
85 WriteDescriptorMap m_write_descriptors;
86 ConnectedDescriptorMap m_connected_read_descriptors;
88 void CheckDescriptors(fd_set *r_set, fd_set *w_set);
89 bool AddDescriptorsToSet(fd_set *r_set, fd_set *w_set,
int *max_sd);
95 #endif // COMMON_IO_SELECTPOLLER_H_ A time interval, with usecond accuracy.
Definition: Clock.h:138
Manages timer events.
Definition: TimeoutManager.h:45
A container for the exported variables.
Definition: ExportMap.h:324
A BidirectionalFileDescriptor that also generates notifications when closed.
Definition: Descriptor.h:282
bool RemoveWriteDescriptor(class WriteFileDescriptor *descriptor)
Unregister a WriteFileDescriptor for write events.
Definition: SelectPoller.cpp:191
Definition: ExportMap.h:176
Export variables on the http server.
bool Poll(TimeoutManager *timeout_manager, const TimeInterval &poll_interval)
Poll the Descriptors for events and execute any callbacks.
Definition: SelectPoller.cpp:202
Used to get the current time.
Definition: Clock.h:242
Represents a file descriptor that supports reading data.
Definition: Descriptor.h:140
bool RemoveReadDescriptor(class ReadFileDescriptor *descriptor)
Unregister a ReadFileDescriptor for read events.
Definition: SelectPoller.cpp:155
An implementation of PollerInterface that uses select().
Definition: SelectPoller.h:43
The namespace containing all OLA symbols.
Definition: Credentials.cpp:44
SelectPoller(ExportMap *export_map, Clock *clock)
Create a new SelectPoller.
Definition: SelectPoller.cpp:100
bool AddWriteDescriptor(class WriteFileDescriptor *descriptor)
Register a WriteFileDescriptor to receive ready-to-write events.
Definition: SelectPoller.cpp:181
The interface for the Poller classes.
Definition: PollerInterface.h:70
Represents a point in time with microsecond accuracy.
Definition: Clock.h:191
Represents a file descriptor that supports writing data.
Definition: Descriptor.h:170
bool AddReadDescriptor(class ReadFileDescriptor *descriptor)
Register a ReadFileDescriptor for read events.
Definition: SelectPoller.cpp:126