![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /******************************************************************************* 00002 * This file is part of openWNS (open Wireless Network Simulator) 00003 * _____________________________________________________________________________ 00004 * 00005 * Copyright (C) 2004-2007 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * phone: ++49-241-80-27910, 00009 * fax: ++49-241-80-22242 00010 * email: info@openwns.org 00011 * www: http://www.openwns.org 00012 * _____________________________________________________________________________ 00013 * 00014 * openWNS is free software; you can redistribute it and/or modify it under the 00015 * terms of the GNU Lesser General Public License version 2 as published by the 00016 * Free Software Foundation; 00017 * 00018 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00019 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00020 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00021 * details. 00022 * 00023 * You should have received a copy of the GNU Lesser General Public License 00024 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00025 * 00026 ******************************************************************************/ 00027 00028 #ifndef LTE_HELPER_QUEUEPROXY_HPP 00029 #define LTE_HELPER_QUEUEPROXY_HPP 00030 00031 #include <LTE/controlplane/RRHandler.hpp> 00032 #include <WNS/scheduler/queue/QueueInterface.hpp> 00033 #include <WNS/scheduler/queue/SimpleQueue.hpp> 00034 #include <WNS/scheduler/SchedulerTypes.hpp> 00035 #include <WNS/probe/bus/ContextCollector.hpp> 00036 00037 namespace lte { namespace helper { 00038 00046 class QueueProxy : 00047 public wns::scheduler::queue::QueueInterface 00048 { 00049 private: 00050 wns::scheduler::queue::QueueInterface* queue; 00051 lte::controlplane::RRHandlerBS* rrhandler; 00052 struct Colleagues { 00053 Colleagues() : registry(NULL) {} 00054 wns::scheduler::RegistryProxyInterface* registry; 00055 } colleagues; 00056 lte::controlplane::RequestStorageInterface* rrStorage; 00058 bool queueIsExternal; 00059 wns::logger::Logger logger; 00060 wns::pyconfig::View config; 00061 wns::probe::bus::contextprovider::Variable* probeContextProviderForCid; 00062 wns::probe::bus::contextprovider::Variable* probeContextProviderForPriority; 00063 wns::probe::bus::ContextCollectorPtr sizeProbeBus; 00064 public: 00065 QueueProxy(wns::ldk::HasReceptorInterface*, const wns::pyconfig::View& config); 00066 virtual ~QueueProxy(); 00067 00068 virtual void 00069 setColleagues(wns::scheduler::RegistryProxyInterface* _registry); 00070 00071 virtual void 00072 setFUN(wns::ldk::fun::FUN* fun); 00073 00075 virtual void 00076 setQueue(wns::scheduler::queue::QueueInterface* _queue); 00077 00079 virtual void 00080 setRRHandler(lte::controlplane::RRHandler* _rrhandler); 00081 00082 virtual bool 00083 isAccepting(const wns::ldk::CompoundPtr& compound) const; 00084 00085 virtual void 00086 put(const wns::ldk::CompoundPtr& compound); 00087 00088 virtual wns::scheduler::UserSet 00089 getQueuedUsers() const; 00090 00091 virtual wns::scheduler::ConnectionSet 00092 getActiveConnections() const; 00093 00094 virtual unsigned long int 00095 numCompoundsForCid(wns::scheduler::ConnectionID cid) const; 00096 00097 virtual unsigned long int 00098 numBitsForCid(wns::scheduler::ConnectionID cid) const; 00099 00100 virtual wns::scheduler::QueueStatusContainer 00101 getQueueStatus() const; 00102 00103 virtual wns::ldk::CompoundPtr 00104 getHeadOfLinePDU(wns::scheduler::ConnectionID cid); 00105 00106 virtual int 00107 getHeadOfLinePDUbits(wns::scheduler::ConnectionID cid); 00108 00109 wns::simulator::Time 00110 getHeadOfLinePDUWaitingTime(wns::scheduler::ConnectionID cid) 00111 { 00112 assure(false, "getHeadOfLinePDUWaitingTime not implemented."); 00113 return 0.0; 00114 }; 00115 00116 virtual bool 00117 isEmpty() const; 00118 00119 virtual bool 00120 hasQueue(wns::scheduler::ConnectionID cid); 00121 00122 virtual bool 00123 queueHasPDUs(wns::scheduler::ConnectionID cid) const; 00124 00125 virtual wns::scheduler::ConnectionSet 00126 filterQueuedCids(wns::scheduler::ConnectionSet connections); 00127 00128 virtual wns::scheduler::queue::QueueInterface::ProbeOutput 00129 resetAllQueues(); 00130 00131 virtual wns::scheduler::queue::QueueInterface::ProbeOutput 00132 resetQueues(wns::scheduler::UserID user); 00133 00134 virtual wns::scheduler::queue::QueueInterface::ProbeOutput 00135 resetQueue(wns::scheduler::ConnectionID cid); 00136 00137 virtual void frameStarts(); 00138 00140 virtual void 00141 writeProbe(wns::scheduler::ConnectionID cid, unsigned int priority) const; 00142 00144 bool supportsDynamicSegmentation() const; 00146 wns::ldk::CompoundPtr getHeadOfLinePDUSegment(wns::scheduler::ConnectionID cid, int bits); 00148 int getMinimumSegmentSize() const; 00149 00152 virtual std::queue<wns::ldk::CompoundPtr> 00153 getQueueCopy(wns::scheduler::ConnectionID cid); 00154 00155 virtual std::string 00156 printAllQueues(); 00157 }; 00158 00159 00160 }} // namespace lte::helper 00161 #endif // LTE_HELPER_PRIORITYQUEUE_HPP 00162 00163
1.5.5