Fawkes API  Fawkes Development Version
objpos_average.h
00001 
00002 /***************************************************************************
00003  *  objpos_average.h - Fawkes WorldModel Object Position Average Fuser
00004  *
00005  *  Created: Tue Jan 13 13:48:49 2009
00006  *  Copyright  2006-2009  Tim Niemueller [www.niemueller.de]
00007  *
00008  ****************************************************************************/
00009 
00010 /*  This program is free software; you can redistribute it and/or modify
00011  *  it under the terms of the GNU General Public License as published by
00012  *  the Free Software Foundation; either version 2 of the License, or
00013  *  (at your option) any later version.
00014  *
00015  *  This program is distributed in the hope that it will be useful,
00016  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  *  GNU Library General Public License for more details.
00019  *
00020  *  Read the full text in the LICENSE.GPL file in the doc directory.
00021  */
00022 
00023 #ifndef __PLUGINS_WORLDMODEL_FUSER_OBJPOS_AVERAGE_H_
00024 #define __PLUGINS_WORLDMODEL_FUSER_OBJPOS_AVERAGE_H_
00025 
00026 #include "fuser.h"
00027 
00028 #include <blackboard/interface_observer.h>
00029 #include <core/utils/lock_list.h>
00030 
00031 #include <string>
00032 
00033 namespace fawkes
00034 {
00035   class BlackBoard;
00036   class Logger;
00037   class ObjectPositionInterface;
00038 }
00039 
00040 class WorldModelObjPosAverageFuser
00041 : public WorldModelFuser,
00042   public fawkes::BlackBoardInterfaceObserver
00043 {
00044  public:
00045   WorldModelObjPosAverageFuser(fawkes::Logger *logger,
00046                                fawkes::BlackBoard *blackboard,
00047                                const char *from_id_pattern, const char *to_id);
00048   ~WorldModelObjPosAverageFuser();
00049 
00050 
00051   virtual void fuse();
00052 
00053   virtual void bb_interface_created(const char *type, const char *id) throw();
00054 
00055  private:
00056   fawkes::BlackBoard *__blackboard;
00057   fawkes::Logger     *__logger;
00058   std::string         __to_id;
00059 
00060   fawkes::LockList<fawkes::ObjectPositionInterface *>  __input_ifs;
00061   fawkes::ObjectPositionInterface                     *__output_if;
00062 
00063   fawkes::LockList<fawkes::ObjectPositionInterface *>::iterator  __iii;
00064 };
00065 
00066 
00067 #endif