2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
4 // Stefan Bund <g0dil@berlios.de>
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 \brief Route public header */
28 #include <boost/type_traits.hpp>
31 //#include "Route.mpp"
32 ///////////////////////////////hh.p////////////////////////////////////////
37 /** \brief Routing base class
39 Routing information is defined within each module to define the control flow. RouteBase is
40 the generic base class for all routing entries.
48 RouteBase(module::Module & module);
51 module::Module * module_;
54 /** \brief Forwarding route base class
56 All routes which may forward control information are based on
57 ForwardingRoute. ForwardingRoute provides methods to control and query the throttling
64 bool autoThrottling() const; ///< Query current autoThrottling state
65 void autoThrottling(bool state); ///< Change automatic throttle notification forwarding
66 /**< By default, throttle notifications are automatically
67 forwarded from active to passive connectors. This may
68 be disabled by setting the authoThrottling state to \c
71 Routing from/to an event to/from a passive connector
72 will automatically create throttling notifications on
73 the connector whenever the event is disabled. Routing
74 form/to an event to/from an active connector will
75 disable the event whenever a throttling notification
76 comes in. Respective for unthrottle notifications.
78 \param[in] state New throttle forwarding state */
80 bool throttled() const; ///< \c true, if the route is throttled
81 /**< This member checks only the automatic throttling
82 state. If autoThrottling() is \c false, this member
83 will always return \c false. */
86 ForwardingRoute(module::Module & module);
88 // Called to register this route with the connectors forwarding information base
89 template <class T> void registerRoute(T & ob);
91 template <class T> void notifyThrottle(T & ob);
92 template <class T> void notifyUnthrottle(T & ob);
95 // called to forward a throttling notification along the route
96 void notifyThrottle();
97 void notifyUnthrottle();
99 // Implemented in the derived classes to forward throttling notifications
100 virtual void v_notifyThrottle() = 0;
101 virtual void v_notifyUnthrottle() = 0;
102 virtual bool v_throttled() const = 0;
104 bool autoThrottling_;
106 friend class connector::ActiveConnector;
111 // We need detail::RouteImplementation here ...
117 /** \brief Route descriptor
119 Route instances are created by Module::route statements. The Route class provides an
120 interface to manipulate the flow processing.
122 The concrete interface provided depends on the type of route. If the route is a forwarding
123 route, it will be based on ForwardingRoute otherwise it will be based directly on
126 template <class Source, class Target>
128 : public detail::RouteImplementation<Source,Target>
131 typedef detail::RouteImplementation<Source,Target> Base;
132 typedef detail::RouteImplementation<Source,Target> Implementation;
134 Route(module::Module & module, Source & source, Target & target);
136 friend class module::Module;
141 ///////////////////////////////hh.e////////////////////////////////////////
151 // c-file-style: "senf"
152 // indent-tabs-mode: nil
153 // ispell-local-dictionary: "american"
154 // compile-command: "scons -u test"
155 // comment-column: 40