namespace senf {
namespace ppi {
+ /** \brief Routing base class
+
+ Routing information is defined within each module to define the control flow. RouteBase is
+ the generic base class for all routing entries.
+ */
class RouteBase
{
public:
module::Module * module_;
};
+ /** \brief Forwarding route base class
+
+ All routes which may forward control information are based on
+ ForwardingRoute. ForwardingRoute provides methods to control and query the throttling
+ behavior.
+ */
class ForwardingRoute
: public RouteBase
{
public:
- bool autoThrottling();
+ bool autoThrottling() const; ///< Query current autoThrottling state
void autoThrottling(bool state); ///< Change automatic throttle notification forwarding
/**< By default, throttle notifications are automatically
forwarded from active to passive connectors. This may
comes in. Respective for unthrottle notifications.
\param[in] state New throttle forwarding state */
+
+ bool throttled() const; ///< \c true, if the route is throttled
+ /**< This member checks only the automatic throttling
+ state. If autoThrottling() is \c false, this member
+ will always return \c false. */
protected:
ForwardingRoute(module::Module & module);
// Called to register this route with the connectors forwarding information base
- void registerRoute(connector::ActiveConnector & connector);
+ template <class T> void registerRoute(T & ob);
template <class T> void notifyThrottle(T & ob);
template <class T> void notifyUnthrottle(T & ob);
// Implemented in the derived classes to forward throttling notifications
virtual void v_notifyThrottle() = 0;
virtual void v_notifyUnthrottle() = 0;
+ virtual bool v_throttled() const = 0;
bool autoThrottling_;
Route instances are created by Module::route statements. The Route class provides an
interface to manipulate the flow processing.
+
+ The concrete interface provided depends on the type of route. If the route is a forwarding
+ route, it will be based on ForwardingRoute otherwise it will be based directly on
+ RouteBase.
*/
template <class Source, class Target>
class Route
: public detail::RouteImplementation<Source,Target>
{
- typedef detail::RouteImplementation<Source,Target> Base;
private:
+ typedef detail::RouteImplementation<Source,Target> Base;
typedef detail::RouteImplementation<Source,Target> Implementation;
Route(module::Module & module, Source & source, Target & target);