X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FRoute.cti;h=c72ad31e9e274413f8a89206f81f17681e6044aa;hb=f2f5d59e83863f3b513950173baee1b6da2aee3c;hp=015ea90fba73d0212d4f2c9dd4fa7e6af864afdb;hpb=f539f4271d470794a773a92bacd8ba086c9bc1cd;p=senf.git diff --git a/PPI/Route.cti b/PPI/Route.cti index 015ea90..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 @@ -31,65 +31,151 @@ ///////////////////////////////cti.p/////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation +// senf::ppi::Route -template -prefix_ -senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, Source & source, Target & target) - : NonForwardingRouteImplementation(module, source, target) +template +prefix_ senf::ppi::Route::Route(module::Module & module, Source & source, + Target & target) + : Base(module,source,target) {} /////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation +// senf::ppi::ForwardingRoute -template -prefix_ -senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, Source & source, Target & target) - : NonForwardingRouteFromEventImplementation(module, source, target) +//////////////////////////////////////// +// 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, Source & source, Target & target) - : NonForwardingRouteToEventImplementation(module, source, target) +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 &) {} -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation +template +template +prefix_ void senf::ppi::detail::ForwardingRouteImplementation:: +notifyUnthrottle(T & ob, boost::mpl::bool_ const &) +{ + ForwardingRoute::notifyUnthrottle(ob); +} -template -prefix_ -senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, connector::ActiveInput & source, Event & target) - : ForwardForwardingRouteToEventImplementation(module, source, target) +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 -template -prefix_ -senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, Event & source, connector::ActiveOutput & target) - : BackwardForwardingRouteFromEventImplementation(module, source, target) +//////////////////////////////////////// +// protected members + +template +prefix_ senf::ppi::detail::RouteImplementation2:: +RouteImplementation2(module::Module & module, Source & source, Target & target) + : Base(module,source,target) {} /////////////////////////////////////////////////////////////////////////// -// senf::ppi::Route +// senf::ppi::detail::RouteImplementation //////////////////////////////////////// // protected members template -prefix_ senf::ppi::Route::Route(module::Module & module, Source & source, - Target & target) - : Implementation(module, source, target) +prefix_ senf::ppi::detail::RouteImplementation:: +RouteImplementation(module::Module & module, Source & source, Target & target) + : Base(module,source,target) {} ///////////////////////////////cti.e///////////////////////////////////////