X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senf%2FPPI%2FRoute.cti;h=d6ed64eb09800f4fff135d3fe70d0925bb522ab6;hb=c505c034e5fdc932c02aa3dc3847a5551011d87e;hp=c72ad31e9e274413f8a89206f81f17681e6044aa;hpb=601d1f509f5bb24df167a4dd5a20da67a0af9af8;p=senf.git diff --git a/senf/PPI/Route.cti b/senf/PPI/Route.cti index c72ad31..d6ed64e 100644 --- a/senf/PPI/Route.cti +++ b/senf/PPI/Route.cti @@ -52,6 +52,12 @@ prefix_ void senf::ppi::ForwardingRoute::registerRoute(T & ob) } template +prefix_ void senf::ppi::ForwardingRoute::unregisterRoute(T & ob) +{ + ob.unregisterRoute(*this); +} + +template prefix_ void senf::ppi::ForwardingRoute::notifyThrottle(T & ob) { ob.notifyThrottle(); @@ -89,6 +95,57 @@ BaseRouteImplementation(module::Module & module, Source & source, Target & targe : 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 @@ -105,6 +162,15 @@ ForwardingRouteImplementation(module::Module & module, Source & source, Target & registerRoute(target); } +template +prefix_ +senf::ppi::detail::ForwardingRouteImplementation:: +~ForwardingRouteImplementation() +{ + unregisterRoute(this->source()); + unregisterRoute(this->target()); +} + //////////////////////////////////////// // private members