00001 /* 00002 Object Oriented Mobile Robot Model (OOMRM) C++ Library Copyright (C) 2002-2006 Derek Jones 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) any later version. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Lesser General Public License for more details. 00013 00014 You should have received a copy of the GNU Lesser General Public 00015 License along with this library; if not, write to the Free Software 00016 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 00018 00019 $Id: function_list.h,v 1.2 2007/10/09 01:59:01 derek Exp $ 00020 00021 */ 00022 #ifndef OOMRM_FOOARRAY_LIST_H 00023 #define OOMRM_FOOARRAY_LIST_H 00024 #include <types.h> 00025 00026 #define FOO_MAX 15 00027 #define NO_FREE_SLOT 255 00028 00030 00034 class function_list 00035 { 00036 public: 00037 function_list(void); 00039 foo function(uint8 fn) const; 00041 void* data(uint8 fn) const; 00043 bool function(foo f, void* datum, uint8 fn); 00044 private: 00045 foo _function[FOO_MAX]; 00046 uint8 _free[FOO_MAX]; // alternative is _used switching logic. 00047 void* _data[FOO_MAX]; 00048 }; 00049 00050 00051 #endif
1.3