X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FRoute.cti;h=c72ad31e9e274413f8a89206f81f17681e6044aa;hb=b89e3166f7680755683dccee5e48cb3a820185c0;hp=3d0f465454731a99820631bcc5bcb96a2520e168;hpb=81ffa1c459b96dd44472bcef37e1e373934ee138;p=senf.git diff --git a/PPI/Route.cti b/PPI/Route.cti index 3d0f465..c72ad31 100644 --- a/PPI/Route.cti +++ b/PPI/Route.cti @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -33,50 +33,149 @@ /////////////////////////////////////////////////////////////////////////// // senf::ppi::Route -//////////////////////////////////////// -// protected members - template prefix_ senf::ppi::Route::Route(module::Module & module, Source & source, Target & target) - : Implementation(module, source, target) + : Base(module,source,target) +{} + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::ForwardingRoute + +//////////////////////////////////////// +// protected members + +template +prefix_ void senf::ppi::ForwardingRoute::registerRoute(T & ob) +{ + ob.registerRoute(*this); +} + +template +prefix_ void senf::ppi::ForwardingRoute::notifyThrottle(T & ob) +{ + ob.notifyThrottle(); +} + +template +prefix_ void senf::ppi::ForwardingRoute::notifyUnthrottle(T & ob) +{ + ob.notifyUnthrottle(); +} + +/////////////////////////////////////////////////////////////////////////// +// senf::ppi::detail::BaseRouteImplementation + +template +prefix_ Source & senf::ppi::detail::BaseRouteImplementation::source() + const +{ + return *source_; +} + +template +prefix_ Target & senf::ppi::detail::BaseRouteImplementation::target() + const +{ + return *target_; +} + +//////////////////////////////////////// +// protected members + +template +prefix_ senf::ppi::detail::BaseRouteImplementation:: +BaseRouteImplementation(module::Module & module, Source & source, Target & target) + : Base(module), source_(&source), target_(&target) {} /////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation +// senf::ppi::detail::ForwardingRouteImplementation //////////////////////////////////////// // protected members -template -prefix_ senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, connector::InputConnector & source, - connector::OutputConnector & target) - : RouteBase(module), source_(&source), target_(&target) +template +prefix_ +senf::ppi::detail::ForwardingRouteImplementation:: +ForwardingRouteImplementation(module::Module & module, Source & source, Target & target) + : Base(module,source,target) +{ + registerRoute(source); + registerRoute(target); +} + +//////////////////////////////////////// +// private members + +template +template +prefix_ void senf::ppi::detail::ForwardingRouteImplementation:: +notifyThrottle(T & ob, boost::mpl::bool_ const &) +{ + ForwardingRoute::notifyThrottle(ob); +} + +template +template +prefix_ void senf::ppi::detail::ForwardingRouteImplementation:: +notifyThrottle(T & ob, boost::mpl::bool_ const &) +{} + +template +template +prefix_ void senf::ppi::detail::ForwardingRouteImplementation:: +notifyUnthrottle(T & ob, boost::mpl::bool_ const &) +{ + ForwardingRoute::notifyUnthrottle(ob); +} + +template +template +prefix_ void senf::ppi::detail::ForwardingRouteImplementation:: +notifyUnthrottle(T & ob, boost::mpl::bool_ const &) {} +template +template +prefix_ bool senf::ppi::detail::ForwardingRouteImplementation:: +throttled(T & ob, boost::mpl::bool_ const &) + const +{ + return ob.throttled(); +} + +template +template +prefix_ bool senf::ppi::detail::ForwardingRouteImplementation:: +throttled(T & ob, boost::mpl::bool_ const &) + const +{ + return false; +} + /////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation +// senf::ppi::detail::RouteImplementation2 //////////////////////////////////////// // protected members -prefix_ senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, EventDescriptor & source, - connector::OutputConnector & target) - : RouteBase(module), source_(&source), target_(&target) +template +prefix_ senf::ppi::detail::RouteImplementation2:: +RouteImplementation2(module::Module & module, Source & source, Target & target) + : Base(module,source,target) {} /////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation +// senf::ppi::detail::RouteImplementation //////////////////////////////////////// // protected members -prefix_ senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, connector::InputConnector & source, - EventDescriptor & target) -: RouteBase(module), source_(&source), target_(&target) +template +prefix_ senf::ppi::detail::RouteImplementation:: +RouteImplementation(module::Module & module, Source & source, Target & target) + : Base(module,source,target) {} ///////////////////////////////cti.e///////////////////////////////////////