![]() |
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-2009 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 WNS_SCHEDULER_QUEUE_SEGMENTINGQUEUE_HPP 00029 #define WNS_SCHEDULER_QUEUE_SEGMENTINGQUEUE_HPP 00030 00031 #include <WNS/scheduler/SchedulerTypes.hpp> 00032 #include <WNS/scheduler/queue/QueueInterface.hpp> 00033 #include <WNS/scheduler/queue/ISegmentationCommand.hpp> 00034 #include <WNS/scheduler/queue/detail/InnerQueue.hpp> 00035 #include <WNS/StaticFactory.hpp> 00036 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00037 00038 #include <WNS/probe/bus/ContextCollector.hpp> 00039 00040 #include <map> 00041 #include <list> 00042 00043 namespace wns { namespace scheduler { namespace queue { 00044 00047 class SegmentingQueue : 00048 public QueueInterface 00049 { 00050 public: 00051 SegmentingQueue(wns::ldk::HasReceptorInterface*, const wns::pyconfig::View& config); 00052 virtual ~SegmentingQueue(); 00053 00054 bool isAccepting(const wns::ldk::CompoundPtr& compound) const; 00056 void put(const wns::ldk::CompoundPtr& compound); 00057 00058 UserSet getQueuedUsers() const; 00059 ConnectionSet getActiveConnections() const; 00060 00061 unsigned long int numCompoundsForCid(ConnectionID cid) const; 00062 unsigned long int numBitsForCid(ConnectionID cid) const; 00063 00064 QueueStatusContainer getQueueStatus() const; 00065 00067 wns::ldk::CompoundPtr getHeadOfLinePDU(ConnectionID cid); 00068 int getHeadOfLinePDUbits(ConnectionID cid); 00069 00070 bool isEmpty() const; 00071 bool hasQueue(ConnectionID cid); 00072 bool queueHasPDUs(ConnectionID cid) const; 00073 ConnectionSet filterQueuedCids(ConnectionSet connections); 00074 00075 void setColleagues(RegistryProxyInterface* _registry); 00077 void setFUN(wns::ldk::fun::FUN* fun); 00078 00079 std::string printAllQueues(); 00080 00081 ProbeOutput resetAllQueues(); 00082 ProbeOutput resetQueues(UserID user); 00083 ProbeOutput resetQueue(ConnectionID cid); 00084 00085 void frameStarts(); 00086 00088 bool supportsDynamicSegmentation() const { return true; } 00090 wns::ldk::CompoundPtr getHeadOfLinePDUSegment(ConnectionID cid, int bits); 00092 int getMinimumSegmentSize() const { return minimumSegmentSize; }; 00093 00097 std::queue<wns::ldk::CompoundPtr> 00098 getQueueCopy(ConnectionID cid); 00099 00100 unsigned long int 00101 getMinimumSegmentSize(){ return minimumSegmentSize;}; 00102 00103 Bit 00104 getFixedHeaderSize(){ return fixedHeaderSize; }; 00105 00106 Bit 00107 getExtensionHeaderSize(){ return fixedHeaderSize; }; 00108 00109 bool 00110 getByteAlignHeader(){ return byteAlignHeader; }; 00111 00112 protected: 00113 void 00114 probe(); 00115 00116 private: 00117 wns::probe::bus::ContextCollectorPtr sizeProbeBus; 00118 wns::probe::bus::ContextCollectorPtr overheadProbeBus; 00119 00120 wns::probe::bus::ContextCollectorPtr delayProbeBus; 00121 wns::ldk::CommandReaderInterface* probeHeaderReader; 00122 00123 wns::ldk::CommandReaderInterface* segmentHeaderReader; 00124 wns::logger::Logger logger; 00125 wns::pyconfig::View config; 00126 wns::ldk::fun::FUN* myFUN; 00127 00128 long int maxSize; 00129 unsigned long int minimumSegmentSize; 00130 00131 typedef std::map<ConnectionID, detail::InnerQueue> QueueContainer; 00132 QueueContainer queues; 00133 00134 typedef std::map<ConnectionID, int> FixedOverheadContainer; 00135 00136 FixedOverheadContainer fixedOverhead; 00137 00138 struct Colleagues { 00139 RegistryProxyInterface* registry; 00140 } colleagues; 00141 00142 Bit fixedHeaderSize; 00143 00144 Bit extensionHeaderSize; 00145 00146 bool usePadding; 00147 00148 bool byteAlignHeader; 00149 00150 bool isDropping; 00151 }; 00152 00153 00154 }}} // namespace wns::scheduler::queue 00155 #endif // WNS_SCHEDULER_QUEUE_SEGMENTINGQUEUE_HPP 00156 00157
1.5.5