User Manual, Developers Guide and API Documentation

QueueProxy.hpp

Go to the documentation of this file.
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_QUEUEPROXY_HPP
00029 #define WNS_SCHEDULER_QUEUE_QUEUEPROXY_HPP
00030 
00031 #include <WNS/scheduler/queue/QueueInterface.hpp>
00032 #include <WNS/scheduler/queue/IQueueManager.hpp>
00033 #include <WNS/scheduler/queue/detail/IInnerCopyQueue.hpp>
00034 #include <WNS/scheduler/SchedulerTypes.hpp>
00035 #include <queue>
00036 
00037 
00038 namespace wns { namespace scheduler { namespace queue {
00039 
00044         class QueueProxy :
00045             public wns::scheduler::queue::QueueInterface
00046             {
00047             public:
00048                 QueueProxy(wns::ldk::HasReceptorInterface*, const wns::pyconfig::View& config);
00049                 virtual ~QueueProxy();
00050 
00051                 bool 
00052                 isAccepting(const wns::ldk::CompoundPtr& compound) const;
00053 
00055                 void 
00056                 put(const wns::ldk::CompoundPtr& compound);
00057 
00058                 wns::scheduler::UserSet 
00059                 getQueuedUsers() const;
00060 
00061                 wns::scheduler::ConnectionSet 
00062                 getActiveConnections() const;
00063 
00064                 unsigned long int 
00065                 numCompoundsForCid(wns::scheduler::ConnectionID cid) const;
00066 
00067                 unsigned long int 
00068                 numBitsForCid(wns::scheduler::ConnectionID cid) const;
00069 
00070                 wns::scheduler::QueueStatusContainer 
00071                 getQueueStatus() const;
00072 
00074                 wns::ldk::CompoundPtr 
00075                 getHeadOfLinePDU(wns::scheduler::ConnectionID cid);
00076 
00077                 int 
00078                 getHeadOfLinePDUbits(wns::scheduler::ConnectionID cid);
00079 
00080                 bool 
00081                 isEmpty() const;
00082 
00083                 bool 
00084                 hasQueue(wns::scheduler::ConnectionID cid);
00085 
00086                 bool 
00087                 queueHasPDUs(wns::scheduler::ConnectionID cid) const;
00088 
00089                 wns::scheduler::ConnectionSet 
00090                 filterQueuedCids(wns::scheduler::ConnectionSet connections);
00091 
00092                 void 
00093                 setColleagues(wns::scheduler::RegistryProxyInterface* _registry);
00094 
00096                 void 
00097                 setFUN(wns::ldk::fun::FUN* fun);
00098 
00099                 std::string 
00100                 printAllQueues();
00101 
00102                 wns::scheduler::queue::QueueInterface::ProbeOutput 
00103                 resetAllQueues();
00104 
00105                 wns::scheduler::queue::QueueInterface::ProbeOutput 
00106                 resetQueues(wns::scheduler::UserID user);
00107 
00108                 wns::scheduler::queue::QueueInterface::ProbeOutput 
00109                 resetQueue(wns::scheduler::ConnectionID cid);
00110 
00111                 void frameStarts();
00112 
00114                 bool 
00115                 supportsDynamicSegmentation() const;
00116 
00118                 wns::ldk::CompoundPtr 
00119                 getHeadOfLinePDUSegment(wns::scheduler::ConnectionID cid, int bits);
00120 
00122                 int 
00123                 getMinimumSegmentSize() const;
00124 
00125 
00129                 virtual std::queue<wns::ldk::CompoundPtr> 
00130                 getQueueCopy(ConnectionID cid);
00131 
00132                 void
00133                 startCollectionIfNeeded(wns::scheduler::ConnectionID cid) const;
00134 
00135 
00136             private:
00137                 void
00138                 createQueueCopyIfNeeded(wns::scheduler::ConnectionID cid) const;
00139 
00140                 struct Colleagues {
00141                     wns::scheduler::RegistryProxyInterface* registry_;
00142                     wns::scheduler::queue::IQueueManager* queueManager_;
00143                 } colleagues;
00144 
00145                 std::string queueManagerServiceName_;
00146                 bool supportsDynamicSegmentation_;
00147                 
00148                 mutable std::map<wns::scheduler::ConnectionID, wns::simulator::Time> lastChecked_;
00149                 mutable std::map<wns::scheduler::ConnectionID, wns::simulator::Time> lastCollected_;
00150                 mutable detail::IInnerCopyQueue* copyQueue_; 
00151  
00152                 wns::logger::Logger logger_;
00153                 wns::ldk::fun::FUN* myFUN_;
00154             };
00155         }}} // namespace wns::scheduler::queue
00156 #endif // WNS_SCHEDULER_QUEUE_QUEUEPROXY_HPP

Generated on Sun May 27 03:31:53 2012 for openWNS by  doxygen 1.5.5