Robot Simulator of the Robotics Group for Self-Organization of Control: callbackable.h Source File

# callbackable.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002  *   Copyright (C) 2005-2011 LpzRobots development team                    *
    00003  *    Georg Martius  <georg dot martius at web dot de>                     *
    00004  *    Frank Guettler <guettler at informatik dot uni-leipzig dot de        *
    00005  *    Frank Hesse    <frank at nld dot ds dot mpg dot de>                  *
    00006  *    Ralf Der       <ralfder at mis dot mpg dot 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 #ifndef _CALLBACKABLE_H
    00025 #define _CALLBACKABLE_H
    00026
    00027 #include "backcaller.h"
    00028
    00029 /**
    00030  * Interface class for a class which wants to be callback on a certain action.
    00031  * In lpzRobots this should be the most case when the time loop is going to the
    00032  * next step.
    00033  *
    00034  * NEW since 20090731:
    00035  * Use the class BackCaller to get already implemented functions like addCallbackable(...).
    00036  *
    00037  * @see BackCaller
    00038  */
    00039 class Callbackable
    00040 {
    00041   public:
    00042
    00043     Callbackable() {};
    00044
    00045     virtual ~Callbackable() {}
    00046
    00047     /**
    00048      * This method is invoked when a callback is done from the class where this
    00049      * class is for callback registered
    00050      * @param source the caller instance which did the callback.
    00051      * @param type this type can be used to differ from varying types of callback.
    00052      * @see BackCaller
    00053      */
    00054     virtual void doOnCallBack(BackCaller* source, BackCaller::CallbackableType type = BackCaller::DEFAULT_CALLBACKABLE_TYPE) = 0;
    00055
    00056
    00057 };
    00058
    00059 #endif