00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef SIENA_FORWARDING_H
00030 #define SIENA_FORWARDING_H
00031
00032 #include <cstddef>
00033
00034 #include <siena/exceptions.h>
00035 #include <siena/types.h>
00036 #include <siena/stst.h>
00037 #include <siena/allocator.h>
00038
00044 namespace siena {
00045
00053 typedef unsigned int if_t;
00054
00067 typedef unsigned int ifid_t;
00068
00083 class MatchHandler {
00084 public:
00086 virtual ~MatchHandler() {};
00087
00096 virtual bool output(if_t) throw() = 0;
00097 };
00098
00110 class MatchMessageHandler {
00111 public:
00113 virtual ~MatchMessageHandler() {};
00114
00125 virtual bool output(if_t, const message &) throw() = 0;
00126 };
00127
00128
00177 class ForwardingTable {
00178 public:
00182 virtual ~ForwardingTable() throw() {};
00183
00194 virtual void ifconfig(if_t,
00195 const predicate &) throw(bad_constraint) = 0;
00211 virtual void consolidate() throw() {};
00212
00226 virtual void match(const message &, MatchHandler &) const
00227 throw() = 0;
00228
00236 virtual void match(const message &, MatchMessageHandler &) const
00237 throw() = 0;
00238
00249 virtual void clear() throw() = 0;
00250
00261 virtual void clear_recycle() throw() = 0;
00262
00269 virtual size_t allocated_bytesize() const throw() = 0;
00270
00277 virtual size_t bytesize() const throw() = 0;
00278 };
00279
00280 }
00281
00282
00283
00284
00285 #include <siena/fwdtable.h>
00286
00287 #endif