00001 #ifndef __TMOUTLST_H_INCLUDED__ 00002 #define __TMOUTLST_H_INCLUDED__ 00003 00004 // $Id$ 00005 00006 //********************************************************************** 00007 // * 00008 // Description: Singleton list to hold instances of Timeout * 00009 // class. * 00010 // Provides a method that iterates through list * 00011 // 'running' each Timeout. * 00012 // * 00013 // Author: Chris White (whitecf@bcs.org.uk) * 00014 // * 00015 // Copyright (C) 2003 Monitor Computing Services Ltd. * 00016 // * 00017 // This program is free software; you can redistribute it and/or * 00018 // modify it under the terms of the GNU General Public License * 00019 // as published by the Free Software Foundation; either version 2 * 00020 // of the License, or any later version. * 00021 // * 00022 // This program is distributed in the hope that it will be useful, * 00023 // but WITHOUT ANY WARRANTY; without even the implied warranty of * 00024 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00025 // GNU General Public License for more details. * 00026 // * 00027 // You should have received a copy of the GNU General Public * 00028 // License (http://www.gnu.org/copyleft/gpl.html) along with this * 00029 // program; if not, write to: * 00030 // The Free Software Foundation Inc., * 00031 // 59 Temple Place - Suite 330, * 00032 // Boston, MA 02111-1307, * 00033 // USA. * 00034 // * 00035 //********************************************************************** 00036 // * 00037 // Notes: * 00038 // * 00039 //********************************************************************** 00040 00041 00042 // Forward declerations 00043 template <class T> class TIListImp; 00044 00045 00046 namespace Monitor { 00047 namespace Utility { 00048 00049 // Forward declerations within namespace 00050 class Timeout; 00051 00052 00057 class TimeoutList 00058 { 00059 public: 00065 static void 00066 addTimeout(Timeout &newTimeout); 00067 00073 static void 00074 removeTimeout(Timeout &oldTimeout); 00075 00081 static void 00082 destroyTimeout(Timeout &oldTimeout); 00083 00088 static void 00089 runTimeouts(); 00090 00094 static unsigned 00095 size(); 00096 00100 static TIListImp< Timeout >& 00101 getList(); 00102 00103 private: 00107 static unsigned& 00108 listSize(); 00109 }; 00110 00111 }; // namespace Utility 00112 }; // namespace Monitor 00113 00114 #endif // __TMOUTLST_H_INCLUDED__