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 // Copyright (C) 2005 Antonio Carzaniga 00011 // 00012 // This program is free software; you can redistribute it and/or 00013 // modify it under the terms of the GNU General Public License 00014 // as published by the Free Software Foundation; either version 2 00015 // of the License, or (at your option) any later version. 00016 // 00017 // This program is distributed in the hope that it will be useful, 00018 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 // GNU General Public License for more details. 00021 // 00022 // You should have received a copy of the GNU General Public License 00023 // along with this program; if not, write to the Free Software 00024 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, 00025 // USA, or send email to one of the authors. 00026 // 00027 // 00028 // $Id: bddbtable.h,v 1.12 2010-03-11 15:16:44 carzanig Exp $ 00029 // 00030 #ifndef SIENA_BDDBTABLE_H 00031 #define SIENA_BDDBTABLE_H 00032 00033 #include <cstddef> 00034 00035 #include <siena/forwarding.h> 00036 #include <siena/allocator.h> 00037 00038 namespace siena { 00039 00051 class BDDBTableBase : public ForwardingTable { 00052 public: 00053 virtual void consolidate() throw(); 00054 00055 virtual void ifconfig(if_t, const predicate &) throw(bad_constraint) = 0; 00056 00057 virtual void match(const message &, MatchHandler &) const throw() = 0; 00058 virtual void match(const message & m, MatchMessageHandler & p) const throw(); 00059 virtual size_t allocated_bytesize() const throw(); 00060 virtual size_t bytesize() const throw(); 00061 00062 virtual void clear() throw() = 0; 00063 virtual void clear_recycle() throw() = 0; 00064 00065 protected: 00071 FTAllocator memory; 00072 }; 00073 00080 class BDDBTable : public BDDBTableBase { 00081 public: 00082 BDDBTable() throw(); 00083 virtual ~BDDBTable() throw(); 00084 00085 virtual void ifconfig(if_t, const predicate &) throw(bad_constraint); 00086 virtual void match(const message &, MatchHandler &) const throw(); 00087 00088 virtual void clear() throw(); 00089 virtual void clear_recycle() throw(); 00090 00091 private: 00092 class IFDescr; 00093 00094 IFDescr * bddlist; 00095 }; 00096 00103 class ZDDBTable : public BDDBTableBase { 00104 public: 00105 ZDDBTable() throw(); 00106 virtual ~ZDDBTable() throw(); 00107 00108 virtual void ifconfig(if_t, const predicate &) throw(bad_constraint); 00109 virtual void match(const message &, MatchHandler &) const throw(); 00110 00111 virtual void clear() throw(); 00112 virtual void clear_recycle() throw(); 00113 00114 private: 00115 class IFDescr; 00116 00117 IFDescr * zddlist; 00118 }; 00119 00120 }; // end namespace siena 00121 00122 #endif