00001 #ifndef __CLLBKLST_H_INCLUDED__ 00002 #define __CLLBKLST_H_INCLUDED__ 00003 00004 // $Id$ 00005 00006 //********************************************************************** 00007 // * 00008 // Description: Callback list class. * 00009 // * 00010 // Author: Chris White (whitecf@bcs.org.uk) * 00011 // * 00012 // Copyright (C) 2003 Monitor Computing Services Ltd. * 00013 // * 00014 // This program is free software; you can redistribute it and/or * 00015 // modify it under the terms of the GNU General Public License * 00016 // as published by the Free Software Foundation; either version 2 * 00017 // of the License, or any later version. * 00018 // * 00019 // This program is distributed in the hope that it will be useful, * 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00022 // GNU General Public License for more details. * 00023 // * 00024 // You should have received a copy of the GNU General Public * 00025 // License (http://www.gnu.org/copyleft/gpl.html) along with this * 00026 // program; if not, write to: * 00027 // The Free Software Foundation Inc., * 00028 // 59 Temple Place - Suite 330, * 00029 // Boston, MA 02111-1307, * 00030 // USA. * 00031 // * 00032 //********************************************************************** 00033 // * 00034 // Notes: * 00035 // * 00036 //********************************************************************** 00037 00038 00039 // Forward declerations 00040 template <class T> class TIListImp; 00041 template <class T> class TIListIteratorImp; 00042 00043 #include <callback.h> 00044 00045 00046 namespace Monitor { 00047 namespace Utility { 00048 00052 class CallbackList 00053 { 00054 public: 00058 CallbackList(); 00059 00063 virtual ~CallbackList(); 00064 00065 00073 const CallbackBase& 00074 addCallback(const CallbackBase& newCallback); 00075 00081 void 00082 removeCallback(const CallbackBase& oldCallback); 00083 00089 void 00090 removeTarget(const void* target); 00091 00097 virtual void 00098 invoke(const void* invocationData = 0); 00099 00100 00101 private: 00105 typedef TIListImp< CallbackBase > List; 00109 typedef TIListIteratorImp< CallbackBase > ListIterator; 00110 00114 List* myList; 00115 }; 00116 00117 }; // namespace Utility 00118 }; // namespace Monitor 00119 00120 #endif // __CLLBKLST_H_INCLUDED__ 00121