Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Examples

ListMediator.hpp

00001 #if !defined(__LISTMEDIATOR_HPP) 00002 #define __LISTMEDIATOR_HPP 00003 00004 /* 00005 CoreLinux++ 00006 Copyright (C) 2000 CoreLinux Consortium 00007 00008 The CoreLinux++ Library is free software; you can redistribute it and/or 00009 modify it under the terms of the GNU Library General Public License as 00010 published by the Free Software Foundation; either version 2 of the 00011 License, or (at your option) any later version. 00012 00013 The CoreLinux++ Library Library is distributed in the hope that it will 00014 be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public 00019 License along with the GNU C Library; see the file COPYING.LIB. If not, 00020 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. 00022 */ 00023 00024 #if !defined(__COMMON_HPP) 00025 #include <corelinux/Common.hpp> 00026 #endif 00027 00028 #if !defined(__COLLEAGUE_HPP) 00029 #include <corelinux/Colleague.hpp> 00030 #endif 00031 00032 #if !defined(__MEDIATOR_HPP) 00033 #include <corelinux/Mediator.hpp> 00034 #endif 00035 00036 #if !defined(__MAP_HPP) 00037 #include <corelinux/Map.hpp> 00038 #endif 00039 00040 #if !defined(__SET_HPP) 00041 #include <corelinux/Set.hpp> 00042 #endif 00043 00044 DECLARE_CLASS( ListColleague ); // Adds to list, notifies of List Change 00045 // Notified of edit change 00046 00047 DECLARE_CLASS( EditColleague ); // Edits list entry, notifies of edit 00048 // Notified of selection 00049 00050 DECLARE_CLASS( SelectColleague ); // Selects from list, notifies of selection 00051 // Notified of List change 00052 00053 DECLARE_CLASS( ListMediator ); 00054 00059 class ListMediator : public CORELINUX( Mediator ) 00060 { 00061 CORELINUX_MAP 00062 ( 00063 DwordIdentifier, 00064 CORELINUX(ColleaguePtr), 00065 less<DwordIdentifier>, 00066 InterestedMap 00067 ); 00068 00069 public: 00070 00071 // 00072 // Constructors and destructor 00073 // 00074 00076 00077 ListMediator( void ); 00078 00080 00081 virtual ~ListMediator( void ); 00082 00083 // 00084 // Mutators 00085 // 00086 00088 00089 void run( void ); 00090 00091 protected: 00092 00094 00095 ListMediator( ListMediatorCref ) 00096 throw ( CORELINUX( Assertion ) ); 00097 00099 00100 ListMediatorRef operator=( ListMediatorCref ) 00101 throw ( CORELINUX( Assertion ) ); 00102 00104 00105 bool operator==( ListMediatorCref ) const 00106 throw ( CORELINUX( Assertion ) ); 00107 00108 // 00109 // Implementation requirements from Mediator 00110 // 00112 00113 virtual void colleagueCreated( CORELINUX(ColleaguePtr) ) ; 00114 00116 00117 virtual CORELINUX(Iterator<corelinux::ColleaguePtr>) *createIterator 00118 ( 00119 CORELINUX(Event<corelinux::Identifier>) * 00120 ) ; 00121 00123 00124 virtual void destroyIterator( CORELINUX(Iterator<corelinux::ColleaguePtr>) * ) ; 00125 00126 00127 private: 00128 00129 ListColleaguePtr theList; 00130 EditColleaguePtr theEditor; 00131 SelectColleaguePtr theSelection; 00132 00134 00135 InterestedMap theInterestedMap; 00136 00137 }; 00138 00139 #endif // if !defined(__LISTMEDIATOR_HPP) 00140 00141 /* 00142 Common rcs information do not modify 00143 $Author: prudhomm $ 00144 $Revision: 1.2 $ 00145 $Date: 2000/08/31 22:49:01 $ 00146 $Locker: $ 00147 */ 00148 00149

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium