X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FRoute.hh;h=e3eee1cf3275e79bae12cb73d6afec17fc575ab6;hb=f539f4271d470794a773a92bacd8ba086c9bc1cd;hp=3d4f513f9c9a688f05a50dafe975e8d211f1f4eb;hpb=217dd10cd636d614ee110f0be293d5d5b5fa646d;p=senf.git diff --git a/PPI/Route.hh b/PPI/Route.hh index 3d4f513..e3eee1c 100644 --- a/PPI/Route.hh +++ b/PPI/Route.hh @@ -25,6 +25,8 @@ #define HH_Route_ 1 // Custom includes +#include +#include "predecl.hh" //#include "Route.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -32,26 +34,29 @@ namespace senf { namespace ppi { - /** \brief Route descriptor - - Route instances are created by Module::route statements. The Route class provides an - interface to manipulate the flow processing. - */ - template - class Route + 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 be disabled by setting the authoThrottling state to \c false. - This member only exists if - \li \a Source or \a Target is an event - \li one of \a Source and \a Target is an active - connector and the other is a passive connector. - Routing from/to an event to/from a passive connector will automatically create throttling notifications on the connector whenever the event is disabled. Routing @@ -59,21 +64,59 @@ namespace ppi { disable the event whenever a throttling notification comes in. Respective for unthrottle notifications. - \param[in] state New throttle forwarding state + \param[in] state New throttle forwarding state */ + + protected: + ForwardingRoute(module::Module & module); + + // Called to register this route with the connectors forwarding information base + void registerRoute(connector::ActiveConnector & connector); + + private: + // 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 { +namespace ppi { + + /** \brief Route descriptor + + Route instances are created by Module::route statements. The Route class provides an + interface to manipulate the flow processing. + */ + template + class Route + : public detail::RouteImplementation + { + private: + typedef detail::RouteImplementation Implementation; + + Route(module::Module & module, Source & source, Target & target); - \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. */ + friend class module::Module; }; }} ///////////////////////////////hh.e//////////////////////////////////////// -//#include "Route.cci" +#include "Route.cci" //#include "Route.ct" -//#include "Route.cti" +#include "Route.cti" #endif @@ -83,4 +126,6 @@ namespace ppi { // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: