Siena Fast Forwarding Documentation (v. 1.13.0)
fwdtable.h
1 // -*- C++ -*-
2 //
3 // This file is part of Siena, a wide-area event notification system.
4 // See http://www.inf.usi.ch/carzaniga/siena/
5 //
6 // Authors: Antonio Carzaniga
7 // See the file AUTHORS for full details.
8 //
9 // Copyright (C) 2001-2003 University of Colorado
10 //
11 // Siena is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // Siena is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with Siena. If not, see <http://www.gnu.org/licenses/>.
23 //
24 #ifndef SIENA_FWDTABLE_H
25 #define SIENA_FWDTABLE_H
26 
27 #include <cstddef> // for size_t
28 
29 #include <siena/exceptions.h>
30 #include <siena/forwarding.h>
31 #include <siena/allocator.h>
32 #include <siena/atable.h>
33 
34 namespace siena {
35 
36 class Interface;
37 class Selectivity;
38 class Attribute;
39 class Constraint;
40 class Filter;
41 class CProcessor;
42 
66 class FwdTable : public ForwardingTable {
67 public:
68  FwdTable();
69 
70  virtual ~FwdTable();
71 
72  virtual void ifconfig(if_t, const predicate &);
73  virtual void consolidate();
74 
75  virtual void match(const message &, MatchHandler &) const;
76  virtual void match(const message &, MatchMessageHandler &) const;
77 
78  virtual void clear();
79  virtual void clear_recycle();
80 
81  virtual size_t allocated_bytesize() const;
82  virtual size_t bytesize() const;
83 
87  void set_preprocess_rounds(unsigned int);
88 
91  unsigned int get_preprocess_rounds() const;
92 
93 private:
99  FTAllocator memory;
100 
108  FTAllocator tmp_memory;
109 
113  ifid_t if_count;
114 
117  unsigned int f_count;
118 
121  unsigned int preprocess_rounds;
122 
125  ATable attributes;
126 
133  Selectivity * selectivity_first;
134 
139  Selectivity * selectivity_last;
140 
151  Selectivity * new_selectivity(const string_t &, ifid_t);
152 
162  void add_to_selectivity(Selectivity *, ifid_t);
163 
167  Attribute * get_attribute(const string_t & name);
168 
172  void connect(Constraint *, Filter *, const string_t &);
173 
174  struct attr_descr_link {
175  Attribute * a;
176  attr_descr_link * next;
177  };
178  attr_descr_link * consolidate_list;
179 };
180 
181 } // end namespace siena
182 
183 #endif