Siena Fast Forwarding Documentation (v. 1.13.0)
forwarding.h
Go to the documentation of this file.
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-2002 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_FORWARDING_H
25 #define SIENA_FORWARDING_H
26 
27 #include <cstddef>
28 
29 #include <siena/exceptions.h>
30 #include <siena/types.h>
31 #include <siena/allocator.h>
32 
38 namespace siena {
39 
47 typedef unsigned int if_t;
48 
61 typedef unsigned int ifid_t;
62 
77 class MatchHandler {
78 public:
80  virtual ~MatchHandler() {};
81 
90  virtual bool output(if_t) = 0;
91 };
92 
105 public:
107  virtual ~MatchMessageHandler() {};
108 
119  virtual bool output(if_t, const message &) = 0;
120 };
121 
122 
172 public:
176  virtual ~ForwardingTable() {};
177 
188  virtual void ifconfig(if_t, const predicate &) = 0;
204  virtual void consolidate() {};
205 
219  virtual void match(const message &, MatchHandler &) const
220  = 0;
221 
229  virtual void match(const message &, MatchMessageHandler &) const
230  = 0;
231 
242  virtual void clear() = 0;
243 
254  virtual void clear_recycle() = 0;
255 
262  virtual size_t allocated_bytesize() const = 0;
263 
270  virtual size_t bytesize() const = 0;
271 };
272 
273 } // end namespace siena
274 
275 //
276 // for source-level compatibility, we also include fwdtable.h here
277 //
278 #include <siena/fwdtable.h>
279 
280 #endif