User Manual, Developers Guide and API Documentation

ULMapCollector.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  * email: info@openwns.org
00009  * www: http://www.openwns.org
00010  * _____________________________________________________________________________
00011  *
00012  * openWNS is free software; you can redistribute it and/or modify it under the
00013  * terms of the GNU Lesser General Public License version 2 as published by the
00014  * Free Software Foundation;
00015  *
00016  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00017  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00018  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00019  * details.
00020  *
00021  * You should have received a copy of the GNU Lesser General Public License
00022  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00023  *
00024  ******************************************************************************/
00025 
00026 
00027 
00028 #ifndef WIMAC_FRAME_ULMAPCOLLECTOR_H
00029 #define WIMAC_FRAME_ULMAPCOLLECTOR_H
00030 
00031 #include <WNS/ldk/ldk.hpp>
00032 #include <WNS/ldk/fcf/CompoundCollector.hpp>
00033 #include <WNS/scheduler/MapInfoProviderInterface.hpp>
00034 #include <WNS/ldk/tools/UpUnconnectable.hpp>
00035 #include <WIMAC/frame/MapCommand.hpp>
00036 
00037 
00038 namespace wimac {
00039     class Component;
00040     class PhyUser;
00041 
00042     namespace service {
00043         class ConnectionManager;
00044     }
00045     namespace scheduler {
00046         class Scheduler;
00047     }
00048 }
00049 
00050 namespace wimac { namespace frame {
00051 
00052     class MapHandlerInterface
00053     {
00054     public:
00055         virtual bool        
00056         resourcesGranted() = 0;
00057 
00058         virtual wns::scheduler::SchedulingMapPtr
00059         getMasterMapForSlaveScheduling() = 0;
00060         
00061                 virtual wns::scheduler::ChannelQualityOnOneSubChannel 
00062         getEstimatedCQI() const { return wns::scheduler::ChannelQualityOnOneSubChannel(); }
00063     };
00064 
00065 
00071         typedef MapCommand ULMapCommand;
00072 
00077         class ULMapCollector :
00078             public wns::ldk::fcf::CompoundCollector,
00079             public wns::ldk::CommandTypeSpecifier<MapCommand>,
00080             public wns::ldk::HasConnector<>,
00081             public wns::ldk::HasReceptor<>,
00082             public wns::ldk::tools::UpUnconnectable,
00083             public wns::Cloneable<ULMapCollector>,
00084             public wns::events::CanTimeout,
00085             virtual public wimac::frame::MapHandlerInterface
00086         {
00087         public:
00088             ULMapCollector( wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config );
00089 
00090             void onFUNCreated();
00091             void calculateSizes( const wns::ldk::CommandPool* commandPool, Bit& commandPoolSize, Bit& dataSize ) const;
00092 
00093             void doOnData( const wns::ldk::CompoundPtr& );
00094 
00095             void doStart(int);
00096 
00097             void onTimeout();
00098 
00099             void doStartCollection(int){}
00100             void finishCollection(){}
00101 
00102             wns::simulator::Time getCurrentDuration() const;
00103 
00104 /* old interface - to be removed*/
00105             wns::simulator::Time getULPhaseDuration() const { return ulPhaseDuration_; }
00106 
00112             wns::simulator::Time getBurstStart() const {
00113                 return burstStartTime_;
00114             }
00115 
00121             wns::simulator::Time getBurstEnd() const {
00122                 return burstEndTime_;
00123             }
00124 
00125             wns::SmartPtr<const wns::service::phy::phymode::PhyModeInterface> getPhyMode() const {
00126                 return burstPhyMode;
00127             }
00128 
00129             wns::scheduler::ChannelQualityOnOneSubChannel getEstimatedCQI() const {
00130                 return estimatedCQI_;
00131             }
00132 
00133             bool hasUplinkBurst() const {
00134                 return hasUplinkBurst_;
00135             }
00136 
00137             wns::scheduler::MapInfoCollectionPtr
00138             getBursts() {return myBursts_;};
00139 
00140 /* new Interface*/
00141             bool resourcesGranted() {
00142                 return ulResourcesAvailable_;
00143             }
00144 
00145              virtual wns::scheduler::SchedulingMapPtr getMasterMapForSlaveScheduling() { 
00146                 return scheduledULMap_;
00147              }
00148             
00149         private:
00150             wimac::scheduler::Scheduler* ulScheduler_;
00151             std::string ulSchedulerName_;
00152             wimac::Component* component_;
00153             wimac::PhyUser* phyUser_;
00154             wimac::service::ConnectionManager* connectionManager_;
00155 
00156             // used variables at the receiving MAP collector
00157 
00161             wns::SmartPtr<const wns::service::phy::phymode::PhyModeInterface> phyMode;
00162 /*old MapCollector variables*/
00163             wns::simulator::Time ulPhaseDuration_;
00164             wns::simulator::Time burstStartTime_;
00165             wns::simulator::Time burstEndTime_;
00166             wns::scheduler::MapInfoCollectionPtr myBursts_;
00167             wns::SmartPtr<const wns::service::phy::phymode::PhyModeInterface> burstPhyMode;
00168             wns::scheduler::ChannelQualityOnOneSubChannel estimatedCQI_;
00169             bool hasUplinkBurst_;
00170 /*new Mapcollector variables*/
00171             wns::scheduler::SchedulingMapPtr scheduledULMap_;
00172 
00177             bool ulResourcesAvailable_;
00178 
00179             wns::scheduler::UserID me_;
00180         };
00181     }
00182 }
00183 #endif
00184 

Generated on Sat May 26 03:32:11 2012 for openWNS by  doxygen 1.5.5