00001 // -*- C++ -*- 00002 // 00003 // This file is part of Siena, a wide-area event notification system. 00004 // See http://www.inf.usi.ch/carzaniga/siena/ 00005 // 00006 // Authors: Antonio Carzaniga 00007 // See the file AUTHORS for full details. 00008 // 00009 // Copyright (C) 2001-2003 University of Colorado 00010 // 00011 // This program is free software; you can redistribute it and/or 00012 // modify it under the terms of the GNU General Public License 00013 // as published by the Free Software Foundation; either version 2 00014 // of the License, or (at your option) any later version. 00015 // 00016 // This program is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License 00022 // along with this program; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, 00024 // USA, or send email to one of the authors. 00025 // 00026 // 00027 // $Id: bctable.h,v 1.5 2010-03-11 15:16:44 carzanig Exp $ 00028 // 00029 #ifndef SIENA_BCTABLE_H 00030 #define SIENA_BCTABLE_H 00031 00032 #ifdef HAVE_CONFIG_H 00033 #include "config.h" 00034 #else 00035 #define CONFIG_BLOOM_FILTER_SIZE 256 00036 #endif 00037 00038 #include <siena/forwarding.h> 00039 #include <siena/allocator.h> 00040 #include <siena/btable.h> 00041 00042 namespace siena { 00043 00044 class BCFilterList; 00045 00058 class BCTable : public BTable { 00059 public: 00060 BCTable() throw(); 00061 00062 virtual ~BCTable() throw(); 00063 00064 virtual void consolidate() throw(); 00065 00066 virtual void match(const message &, MatchHandler &) const throw(); 00067 00068 private: 00073 BCFilterList * positions[CONFIG_BLOOM_FILTER_SIZE]; 00074 unsigned int f_counter; 00075 unsigned int if_counter; 00076 }; 00077 00078 } // end namespace siena 00079 00080 #endif