31 #ifndef ASYNC_CPP_APPLICATION_INCLUDED
32 #define ASYNC_CPP_APPLICATION_INCLUDED
41 #include <sys/types.h>
42 #include <sys/select.h>
45 #include <sigc++/sigc++.h>
136 class CppApplication :
public Application
192 bool operator()(
const struct timespec& t1,
const struct timespec& t2)
const
194 return ((t1.tv_sec == t2.tv_sec)
195 ? (t1.tv_nsec < t2.tv_nsec)
196 : (t1.tv_sec < t2.tv_sec));
199 typedef std::map<int, FdWatch*> WatchMap;
200 typedef std::multimap<struct timespec, Timer *, lttimespec> TimerMap;
201 typedef std::map<int, struct sigaction> UnixSignalMap;
203 static int sighandler_pipe[2];
209 WatchMap rd_watch_map;
210 WatchMap wr_watch_map;
212 UnixSignalMap unix_signals;
213 int unix_signal_recv;
214 size_t unix_signal_recv_cnt;
216 static void unixSignalHandler(
int signum);
218 void addFdWatch(
FdWatch *fd_watch);
219 void delFdWatch(
FdWatch *fd_watch);
220 void addTimer(
Timer *timer);
221 void addTimerP(
Timer *timer,
const struct timespec& current);
222 void delTimer(
Timer *timer);
223 DnsLookupWorker *newDnsLookupWorker(
const std::string& label);
224 void handleUnixSignal(
void);