X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FQueueing.cc;h=1240626bc923b8386b88c87fee0db236a9439f8f;hb=f2f5d59e83863f3b513950173baee1b6da2aee3c;hp=c084f51db68765dbd0966ee4419e8f46ca3c4783;hpb=81ffa1c459b96dd44472bcef37e1e373934ee138;p=senf.git diff --git a/PPI/Queueing.cc b/PPI/Queueing.cc index c084f51..1240626 100644 --- a/PPI/Queueing.cc +++ b/PPI/Queueing.cc @@ -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 @@ -27,16 +27,28 @@ //#include "Queueing.ih" // Custom includes +#include "Connectors.hh" //#include "Queueing.mpp" #define prefix_ ///////////////////////////////cc.p//////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// -// senf::ppi::QueueingDiscipline +// senf::ppi::ThresholdQueueing -prefix_ senf::ppi::QueueingDiscipline::~QueueingDiscipline() -{} +prefix_ void senf::ppi::ThresholdQueueing::update(connector::GenericPassiveInput & input, Event event) +{ + switch (event) { + case ENQUEUE: + if (input.queueSize() >= high_) + input.throttle(); + break; + case DEQUEUE: + if (input.queueSize() <= low_) + input.unthrottle(); + break; + } +} ///////////////////////////////cc.e//////////////////////////////////////// #undef prefix_