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> 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);
void catchUnixSignal(int signum)
Catch the specified UNIX signal.
void uncatchUnixSignal(int signum)
Uncatch the specified UNIX signal.
The base class for asynchronous applications.
void quit(void)
Exit the application main loop.
The core class for writing asyncronous applications.
sigc::signal< void, int > unixSignalCaught
A signal that is emitted when a monitored UNIX signal is caught.
A class that produces timer events.
A class for watching file descriptors.
void exec(void)
Execute the application main loop.
Namespace for the asynchronous programming classes.
~CppApplication(void)
Destructor.
An application class for writing non GUI applications.
CppApplication(void)
Constructor.