00001 /*************************************************************************** 00002 * Copyright (C) 2005 by Robot Group Leipzig * 00003 * martius@informatik.uni-leipzig.de * 00004 * fhesse@informatik.uni-leipzig.de * 00005 * der@informatik.uni-leipzig.de * 00006 * guettler@informatik.uni-leipzig.de * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the * 00020 * Free Software Foundation, Inc., * 00021 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00022 *************************************************************************** 00023 * * 00024 * DESCRIPTION * 00025 * 00026 * * 00027 * * 00028 * $Log: mediatorcollegue.h,v $ 00029 * Revision 1.1 2009/08/10 07:34:49 guettler 00030 * -Base classes which support use of design pattern 00031 * mediator - similar to callbackable, but with more functionality: 00032 * The mediator takes a more central role in mediation, the collegues 00033 * are able to inform the mediator that something happend with 00034 * easy use of mediated events (MediatorEvent). 00035 * * 00036 * * 00037 **************************************************************************/ 00038 #ifndef __MEDIATORCOLLEGUE_H_ 00039 #define __MEDIATORCOLLEGUE_H_ 00040 00041 //#include "mediator.h" 00042 00043 class Mediator; 00044 class MediatorEvent; 00045 00046 class MediatorCollegue 00047 { 00048 public: 00049 typedef unsigned long InformMediatorType; 00050 00051 static const InformMediatorType DEFAULT_INFORM_MEDIATOR_TYPE = 0; 00052 00053 MediatorCollegue(Mediator* myMediator); 00054 virtual ~MediatorCollegue(); 00055 00056 /** 00057 * Calls the mediator that this collegue has performed something. 00058 * The event and the instance of this class is handed over. 00059 */ 00060 void informMediator(MediatorEvent* event); 00061 00062 /** 00063 * Is called when the mediator informs this collegue that an event 00064 * has to be performed by this collegue instance. 00065 */ 00066 virtual void doOnMediatorCallBack(MediatorEvent* event) = 0; 00067 00068 private: 00069 00070 Mediator* myMediator; 00071 }; 00072 00073 #endif /* _MEDIATORCOLLEGUE_H_ */