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 #include <new>
00034
00035 #include <siena/exceptions.h>
00036 #include <siena/types.h>
00037 #include <siena/stst.h>
00038 #include <siena/allocator.h>
00039
00045 namespace siena {
00046
00054 typedef unsigned int if_t;
00055
00068 typedef unsigned int ifid_t;
00069
00084 class MatchHandler {
00085 public:
00087 virtual ~MatchHandler() {};
00088
00097 virtual bool output(if_t) throw() = 0;
00098 };
00099
00111 class MatchMessageHandler {
00112 public:
00114 virtual ~MatchMessageHandler() {};
00115
00126 virtual bool output(if_t, const message &) throw() = 0;
00127 };
00128
00129
00178 class ForwardingTable {
00179 public:
00183 virtual ~ForwardingTable() throw() {};
00184
00195 virtual void ifconfig(if_t, const predicate &) throw(bad_constraint, std::bad_alloc) = 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