// $Id$ // // Copyright (C) 2007 // Fraunhofer Institute for Open Communication Systems (FOKUS) // // The contents of this file are subject to the Fraunhofer FOKUS Public License // Version 1.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // http://senf.berlios.de/license.html // // The Fraunhofer FOKUS Public License Version 1.0 is based on, // but modifies the Mozilla Public License Version 1.1. // See the full license text for the amendments. // // Software distributed under the License is distributed on an "AS IS" basis, // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License // for the specific language governing rights and limitations under the License. // // The Original Code is Fraunhofer FOKUS code. // // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. // (registered association), Hansastraße 27 c, 80686 Munich, Germany. // All Rights Reserved. // // Contributor(s): // Stefan Bund /** \file \brief Route inline template implementation */ #include "Route.ih" // Custom includes #define prefix_ inline //-///////////////////////////////////////////////////////////////////////////////////////////////// //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::ppi::Route template prefix_ senf::ppi::Route::Route(module::Module & module, Source & source, Target & 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::unregisterRoute(T & ob) { ob.unregisterRoute(*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) {} //-///////////////////////////////////////////////////////////////////////////////////////////////// // private members template prefix_ bool senf::ppi::detail::BaseRouteImplementation:: v_hasConnector(connector::Connector const & conn) const { return isSame(conn, source()) || isSame(conn, target()); } template prefix_ bool senf::ppi::detail::BaseRouteImplementation:: v_hasEvent(EventDescriptor const & event) const { return isSame(event, source()) || isSame(event, target()); } template prefix_ bool senf::ppi::detail::BaseRouteImplementation:: isSame(connector::Connector const & conn, connector::Connector const & other) const { return &conn == &other; } template prefix_ bool senf::ppi::detail::BaseRouteImplementation:: isSame(connector::Connector const & conn, EventDescriptor const & other) const { return false; } template prefix_ bool senf::ppi::detail::BaseRouteImplementation:: isSame(EventDescriptor const & event, connector::Connector const & other) const { return false; } template prefix_ bool senf::ppi::detail::BaseRouteImplementation:: isSame(EventDescriptor const & event, EventDescriptor const & other) const { return &event == &other; } //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::ppi::detail::ForwardingRouteImplementation //-///////////////////////////////////////////////////////////////////////////////////////////////// // protected members template prefix_ senf::ppi::detail::ForwardingRouteImplementation:: ForwardingRouteImplementation(module::Module & module, Source & source, Target & target) : Base(module,source,target) { Base::registerRoute(source); Base::registerRoute(target); } template prefix_ senf::ppi::detail::ForwardingRouteImplementation:: ~ForwardingRouteImplementation() { Base::unregisterRoute(this->source()); Base::unregisterRoute(this->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::RouteImplementation2 //-///////////////////////////////////////////////////////////////////////////////////////////////// // protected members template prefix_ senf::ppi::detail::RouteImplementation2:: RouteImplementation2(module::Module & module, Source & source, Target & target) : Base(module,source,target) {} //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::ppi::detail::RouteImplementation //-///////////////////////////////////////////////////////////////////////////////////////////////// // protected members template prefix_ senf::ppi::detail::RouteImplementation:: RouteImplementation(module::Module & module, Source & source, Target & target) : Base(module,source,target) {} //-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ // Local Variables: // mode: c++ // fill-column: 100 // comment-column: 40 // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" // compile-command: "scons -u test" // End: