X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FRoute.hh;h=e3eee1cf3275e79bae12cb73d6afec17fc575ab6;hb=f539f4271d470794a773a92bacd8ba086c9bc1cd;hp=54c41396d2499c58001259565d05103ec68a847e;hpb=81ffa1c459b96dd44472bcef37e1e373934ee138;p=senf.git diff --git a/PPI/Route.hh b/PPI/Route.hh index 54c4139..e3eee1c 100644 --- a/PPI/Route.hh +++ b/PPI/Route.hh @@ -37,6 +37,20 @@ namespace ppi { class RouteBase { public: + virtual ~RouteBase(); + + protected: + RouteBase(module::Module & module); + + private: + module::Module * module_; + }; + + class ForwardingRoute + : public RouteBase + { + public: + bool autoThrottling(); void autoThrottling(bool state); ///< Change automatic throttle notification forwarding /**< By default, throttle notifications are automatically forwarded from active to passive connectors. This may @@ -50,23 +64,31 @@ namespace ppi { disable the event whenever a throttling notification comes in. Respective for unthrottle notifications. - \param[in] state New throttle forwarding state - - \implementation This class will be implemented using a - baseclass, this template and several - specializations. However, this is an implementation - detail which does not affect the exposed - interface. */ - + \param[in] state New throttle forwarding state */ + protected: - RouteBase(module::Module & module); + ForwardingRoute(module::Module & module); + + // Called to register this route with the connectors forwarding information base + void registerRoute(connector::ActiveConnector & connector); private: - module::Module * module_; + // called to forward a throttling notification along the route + void notifyThrottle(); + void notifyUnthrottle(); + + // Implemented in the derived classes to forward throttling notifications + virtual void v_notifyThrottle() = 0; + virtual void v_notifyUnthrottle() = 0; + + bool autoThrottling_; + + friend class connector::ActiveConnector; }; }} +// We need detail::RouteImplementation here ... #include "Route.ih" namespace senf { @@ -79,13 +101,10 @@ namespace ppi { */ template class Route - : public detail::RouteImplementation< boost::is_base_of::value, - boost::is_base_of::value > + : public detail::RouteImplementation { private: - typedef detail::RouteImplementation< - boost::is_base_of::value, - boost::is_base_of::value > Implementation; + typedef detail::RouteImplementation Implementation; Route(module::Module & module, Source & source, Target & target);