ARPDAS_QNX6 1.0
|
00001 #ifndef TIMEOUT_H_INCLUDED 00002 #define TIMEOUT_H_INCLUDED 00003 00004 #include <time.h> 00005 #include <sys/select.h> 00006 00007 class Timeout { 00008 public: 00009 Timeout(); 00010 // Timeout( time_t secs, long msecs ); 00011 void Set( time_t secs, long msecs ); 00012 void Clear(); 00013 bool Set(); 00014 bool Expired(); 00015 struct timespec when; 00016 }; 00017 00018 class TimeoutAccumulator { 00019 public: 00020 TimeoutAccumulator(); 00021 void Set( Timeout * ); 00022 void Set_Min( Timeout * ); 00023 struct timeval *timeout_val(); 00024 private: 00025 struct timespec when; 00026 struct timeval how_soon; 00027 }; 00028 00029 #endif