Utils/Console: Add short help to 'ls' output
[senf.git] / PPI / Route.cti
index a136aff..c72ad31 100644 (file)
@@ -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 <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
@@ -46,6 +46,12 @@ prefix_ senf::ppi::Route<Source,Target>::Route(module::Module & module, Source &
 // protected members
 
 template <class T>
+prefix_ void senf::ppi::ForwardingRoute::registerRoute(T & ob)
+{
+    ob.registerRoute(*this);
+}
+
+template <class T>
 prefix_ void senf::ppi::ForwardingRoute::notifyThrottle(T & ob)
 {
     ob.notifyThrottle();
@@ -62,12 +68,14 @@ prefix_ void senf::ppi::ForwardingRoute::notifyUnthrottle(T & ob)
 
 template <class Source, class Target, class Base>
 prefix_ Source & senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::source()
+    const
 {
     return *source_;
 }
 
 template <class Source, class Target, class Base>
 prefix_ Target & senf::ppi::detail::BaseRouteImplementation<Source,Target,Base>::target()
+    const
 {
     return *target_;
 }
@@ -93,8 +101,8 @@ senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
 ForwardingRouteImplementation(module::Module & module, Source & source, Target & target)
     : Base(module,source,target)
 {
-    registerRoute(source, boost::mpl::bool_<RoutingTraits<Source>::notifySource>());
-    registerRoute(target, boost::mpl::bool_<RoutingTraits<Target>::notifySource>());
+    registerRoute(source);
+    registerRoute(target);
 }
 
 ////////////////////////////////////////
@@ -103,44 +111,48 @@ ForwardingRouteImplementation(module::Module & module, Source & source, Target &
 template <class Source, class Target>
 template <class T>
 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
-registerRoute(T & ob, boost::mpl::bool_<true> const &)
+notifyThrottle(T & ob, boost::mpl::bool_<true> const &)
 {
-    ForwardingRoute::registerRoute(ob);
+    ForwardingRoute::notifyThrottle(ob);
 }
 
 template <class Source, class Target>
 template <class T>
 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
-registerRoute(T & ob, boost::mpl::bool_<false> const &)
+notifyThrottle(T & ob, boost::mpl::bool_<false> const &)
 {}
 
 template <class Source, class Target>
 template <class T>
 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
-notifyThrottle(T & ob, boost::mpl::bool_<true> const &)
+notifyUnthrottle(T & ob, boost::mpl::bool_<true> const &)
 {
-    ForwardingRoute::notifyThrottle(ob);
+    ForwardingRoute::notifyUnthrottle(ob);
 }
 
 template <class Source, class Target>
 template <class T>
 prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
-notifyThrottle(T & ob, boost::mpl::bool_<false> const &)
+notifyUnthrottle(T & ob, boost::mpl::bool_<false> const &)
 {}
 
 template <class Source, class Target>
 template <class T>
-prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
-notifyUnthrottle(T & ob, boost::mpl::bool_<true> const &)
+prefix_ bool senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
+throttled(T & ob, boost::mpl::bool_<true> const &)
+    const
 {
-    ForwardingRoute::notifyUnthrottle(ob);
+    return ob.throttled();
 }
 
 template <class Source, class Target>
 template <class T>
-prefix_ void senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
-notifyUnthrottle(T & ob, boost::mpl::bool_<false> const &)
-{}
+prefix_ bool senf::ppi::detail::ForwardingRouteImplementation<Source,Target>::
+throttled(T & ob, boost::mpl::bool_<false> const &)
+    const
+{
+    return false;
+}
 
 ///////////////////////////////////////////////////////////////////////////
 // senf::ppi::detail::RouteImplementation2<Source,Target>