X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FRoute.cci;h=0a3117ad84a03274f5527f08fc9259c7e90fc4bb;hb=a1fdb7bb122f0b05be809a922d4b7ef5e125fa67;hp=01c6f3ade621fcb4fee4bea1bda4149a1a44a7da;hpb=f539f4271d470794a773a92bacd8ba086c9bc1cd;p=senf.git diff --git a/PPI/Route.cci b/PPI/Route.cci index 01c6f3a..0a3117a 100644 --- a/PPI/Route.cci +++ b/PPI/Route.cci @@ -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 @@ -47,6 +47,7 @@ prefix_ senf::ppi::RouteBase::RouteBase(module::Module & module) // senf::ppi::ForwardingRoute prefix_ bool senf::ppi::ForwardingRoute::autoThrottling() + const { return autoThrottling_; } @@ -56,18 +57,19 @@ prefix_ void senf::ppi::ForwardingRoute::autoThrottling(bool state) autoThrottling_ = state; } +prefix_ bool senf::ppi::ForwardingRoute::throttled() + const +{ + return v_throttled(); +} + //////////////////////////////////////// // protected members prefix_ senf::ppi::ForwardingRoute::ForwardingRoute(module::Module & module) - : RouteBase(module), autoThrottling_(false) + : RouteBase(module), autoThrottling_(true) {} -prefix_ void senf::ppi::ForwardingRoute::registerRoute(connector::ActiveConnector & connector) -{ - connector.registerRoute(*this); -} - //////////////////////////////////////// // private members @@ -81,164 +83,6 @@ prefix_ void senf::ppi::ForwardingRoute::notifyUnthrottle() v_notifyUnthrottle(); } -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::NonForwardingRouteImplementation - -prefix_ senf::ppi::detail::NonForwardingRouteImplementation:: -NonForwardingRouteImplementation(module::Module & module, connector::InputConnector & source, - connector::OutputConnector & target) - : RouteBase(module), source_(&source), target_(&target) -{} - -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::NonForwardingRouteToEventImplementation - -prefix_ -senf::ppi::detail::NonForwardingRouteToEventImplementation:: -NonForwardingRouteToEventImplementation(module::Module & module, - connector::InputConnector & source, - EventDescriptor & target) - : RouteBase(module), source_(&source), target_(&target) -{} - -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::NonForwardingRouteFromEventImplementation - -prefix_ -senf::ppi::detail::NonForwardingRouteFromEventImplementation:: -NonForwardingRouteFromEventImplementation(module::Module & module, EventDescriptor & source, - connector::OutputConnector & target) - : RouteBase(module), source_(&source), target_(&target) -{} - -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::ForwardForwardingRouteImplementation - -prefix_ -senf::ppi::detail::ForwardForwardingRouteImplementation:: -ForwardForwardingRouteImplementation(module::Module & module, connector::ActiveInput & source, - connector::PassiveOutput & target) - : ForwardingRoute(module), source_(&source), target_(&target) -{ - registerRoute(*source_); -} - -prefix_ void senf::ppi::detail::ForwardForwardingRouteImplementation::v_notifyThrottle() -{ - if (autoThrottling()) - target_->notifyThrottle(); -} - -prefix_ void senf::ppi::detail::ForwardForwardingRouteImplementation::v_notifyUnthrottle() -{ - if (autoThrottling()) - target_->notifyUnthrottle(); -} - -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::BackwardForwardingRouteImplementation - -prefix_ -senf::ppi::detail::BackwardForwardingRouteImplementation:: -BackwardForwardingRouteImplementation(module::Module & module, - connector::PassiveInput & source, - connector::ActiveOutput & target) - : ForwardingRoute(module), source_(&source), target_(&target) -{ - registerRoute(*target_); -} - -prefix_ void senf::ppi::detail::BackwardForwardingRouteImplementation::v_notifyThrottle() -{ - if (autoThrottling()) - source_->notifyThrottle(); -} - -prefix_ void senf::ppi::detail::BackwardForwardingRouteImplementation::v_notifyUnthrottle() -{ - if (autoThrottling()) - source_->notifyUnthrottle(); -} - -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::ForwardForwardingRouteToEventImplementation - -prefix_ -senf::ppi::detail::ForwardForwardingRouteToEventImplementation:: -ForwardForwardingRouteToEventImplementation(module::Module & module, - connector::ActiveInput & source, - EventDescriptor & target) - : ForwardingRoute(module), source_(&source), target_(&target) -{ - registerRoute(*source_); -} - -prefix_ void senf::ppi::detail::ForwardForwardingRouteToEventImplementation::v_notifyThrottle() -{ - if (autoThrottling()) - target_->enabled(false); -} - -prefix_ void -senf::ppi::detail::ForwardForwardingRouteToEventImplementation::v_notifyUnthrottle() -{ - if (autoThrottling()) - target_->enabled(true); -} - -/////////////////////////////////////////////////////////////////////////// -//senf::ppi::detail::BackwardForwardingRouteFromEventImplementation - -prefix_ -senf::ppi::detail::BackwardForwardingRouteFromEventImplementation:: -BackwardForwardingRouteFromEventImplementation(module::Module & module, - EventDescriptor & source, - connector::ActiveOutput & target) - : ForwardingRoute(module), source_(&source), target_(&target) -{ - registerRoute(*target_); -} - -prefix_ void -senf::ppi::detail::BackwardForwardingRouteFromEventImplementation::v_notifyThrottle() -{ - if (autoThrottling()) - source_->enabled(false); -} - -prefix_ void -senf::ppi::detail::BackwardForwardingRouteFromEventImplementation::v_notifyUnthrottle() -{ - if (autoThrottling()) - source_->enabled(true); -} - -/////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation - -prefix_ -senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, connector::ActiveInput & source, - connector::PassiveOutput & target) - : ForwardForwardingRouteImplementation(module, source, target) -{} - -//////////////////////////////////////////////////////////////////////////// -// senf::ppi::detail::RouteImplementation - -prefix_ -senf::ppi::detail::RouteImplementation:: -RouteImplementation(module::Module & module, connector::PassiveInput & source, - connector::ActiveOutput & target) - : BackwardForwardingRouteImplementation(module, source, target) -{} - ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_