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 * frankguettler@gmx.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 * Uses design pattern mediator: * 00026 * BackCaller - subject and changemanager (combined) * 00027 * Callbackable - observer * 00028 * * 00029 * $Log: callbackable.h,v $ 00030 * Revision 1.2 2009/08/10 07:31:04 guettler 00031 * -new BackCaller class to provide common 00032 * functions used for callback 00033 * -Callbackable interface modified 00034 * -callBack now supports different types 00035 * of CallBackable types 00036 * 00037 * Revision 1.1 2007/05/07 21:04:44 robot3 00038 * added interface class, which provides the possibility, that an implementing class 00039 * can have a callback from another class where the implementing class is registered 00040 * for the callback. 00041 * 00042 * * 00043 ***************************************************************************/ 00044 #ifndef _CALLBACKABLE_H 00045 #define _CALLBACKABLE_H 00046 00047 #include "backcaller.h" 00048 00049 /** 00050 * Interface class for a class which wants to be callback on a certain action. 00051 * In lpzRobots this should be the most case when the time loop is going to the 00052 * next step. 00053 * 00054 * NEW since 20090731: 00055 * Use the class BackCaller to get already implemented functions like addCallbackable(...). 00056 * 00057 * @see BackCaller 00058 */ 00059 class Callbackable 00060 { 00061 public: 00062 00063 Callbackable() {}; 00064 00065 virtual ~Callbackable() {} 00066 00067 /** 00068 * This method is invoked when a callback is done from the class where this 00069 * class is for callback registered 00070 * @param source the caller instance which did the callback. 00071 * @param type this type can be used to differ from varying types of callback. 00072 * @see BackCaller 00073 */ 00074 virtual void doOnCallBack(BackCaller* source, BackCaller::CallbackableType type = BackCaller::DEFAULT_CALLBACKABLE_TYPE) = 0; 00075 00076 00077 }; 00078 00079 #endif