4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief Connectors non-inline non-template implementation */
26 #include "Connectors.hh"
27 //#include "Connectors.ih"
32 //#include "Connectors.mpp"
34 ///////////////////////////////cc.p////////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////////
37 // senf::ppi::connector::PassiveConnector
39 ////////////////////////////////////////
42 prefix_ void senf::ppi::connector::PassiveConnector::notifyUnthrottle()
44 if (throttled() && !nativeThrottled_) {
45 Routes::const_iterator i (routes_.begin());
46 Routes::const_iterator const i_end (routes_.end());
47 for (; i != i_end; ++i)
48 if ((*i)->throttled())
51 remoteThrottled_ = false;
56 remoteThrottled_ = false;
59 ///////////////////////////////////////////////////////////////////////////
60 // senf::ppi::connector::ActiveConnector
62 ////////////////////////////////////////
65 prefix_ void senf::ppi::connector::ActiveConnector::notifyThrottle()
67 if (throttleCallback_)
69 NotifyRoutes::const_iterator i (notifyRoutes_.begin());
70 NotifyRoutes::const_iterator const i_end (notifyRoutes_.end());
71 for (; i != i_end; ++i)
72 (*i)->notifyThrottle();
75 prefix_ void senf::ppi::connector::ActiveConnector::notifyUnthrottle()
77 if (unthrottleCallback_)
78 unthrottleCallback_();
79 NotifyRoutes::const_iterator i (notifyRoutes_.begin());
80 NotifyRoutes::const_iterator const i_end (notifyRoutes_.end());
81 for (; i != i_end; ++i)
82 (*i)->notifyUnthrottle();
85 prefix_ void senf::ppi::connector::ActiveConnector::registerRoute(ForwardingRoute & route)
87 notifyRoutes_.push_back(&route);
90 ///////////////////////////////////////////////////////////////////////////
91 // senf::ppi::connector::InputConnector
93 prefix_ senf::Packet senf::ppi::connector::InputConnector::operator()()
106 ////////////////////////////////////////
109 prefix_ void senf::ppi::connector::InputConnector::v_requestEvent()
112 prefix_ void senf::ppi::connector::InputConnector::v_enqueueEvent()
115 prefix_ void senf::ppi::connector::InputConnector::v_dequeueEvent()
118 ///////////////////////////////////////////////////////////////////////////
119 // senf::ppi::connector::ActiveInput
121 ////////////////////////////////////////
124 prefix_ void senf::ppi::connector::ActiveInput::v_requestEvent()
129 ///////////////////////////////////////////////////////////////////////////
130 // senf::ppi::connector::PassiveInput
132 ////////////////////////////////////////
135 prefix_ void senf::ppi::connector::PassiveInput::v_enqueueEvent()
138 qdisc_->update(*this, QueueingDiscipline::ENQUEUE);
141 prefix_ void senf::ppi::connector::PassiveInput::v_dequeueEvent()
143 qdisc_->update(*this, QueueingDiscipline::DEQUEUE);
146 prefix_ void senf::ppi::connector::PassiveInput::v_unthrottleEvent()
148 size_type n (queueSize());
151 size_type nn (queueSize());
158 ///////////////////////////////cc.e////////////////////////////////////////
160 //#include "Connectors.mpp"
166 // comment-column: 40
167 // c-file-style: "senf"
168 // indent-tabs-mode: nil
169 // ispell-local-dictionary: "american"
170 // compile-command: "scons -u test"