Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Timeout.h

00001 #ifndef ERIS_TIMEOUT_H
00002 #define ERIS_TIMEOUT_H
00003 
00004 #include <Eris/Types.h>
00005 #include <Eris/Timestamp.h>
00006 
00007 namespace Eris {
00008 
00010 class Timeout : virtual public SigC::Object
00011 {
00012 public: 
00016         Timeout(const std::string &label, unsigned long milli);
00017         Timeout();
00018         ~Timeout();
00019 
00021         Timeout& operator=(const Timeout &t);
00022 
00026         void extend(unsigned long msec);
00027 
00030         void reset(unsigned long msec);
00031         
00033         void cancel();
00034         unsigned long poll(const Time::Stamp &t);
00035         
00037         bool isExpired() const;
00038 
00040         SigC::Signal0<void> Expired;
00041 
00043 
00047         static const Timeout* findByName(const std::string &lbl);
00048 
00053         static unsigned long pollAll();
00054 
00057         static void extendByName(const std::string &lbl, unsigned long msec);
00058         
00061         static void cancelByName(const std::string &lbl);
00062 
00063 protected:
00064         const std::string _label;       
00065         Time::Stamp _due;                       
00066         bool _fired;                            
00067 
00068         typedef std::map<std::string, Timeout*> TimeoutMap;
00069         static TimeoutMap _allTimeouts;
00070 
00071 private:
00074         Timeout(const Timeout &t);
00075 };
00076 
00077 } // of Eris namespace
00078 
00079 #endif

Generated on Thu May 22 08:01:04 2003 for Eris by doxygen1.3-rc3