User Manual, Developers Guide and API Documentation

DCF.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WiMeMac                                                                    *
00003  * This file is part of openWNS (open Wireless Network Simulator)
00004  * _____________________________________________________________________________
00005  *
00006  * Copyright (C) 2004-2011
00007  * Chair of Communication Networks (ComNets)
00008  * Kopernikusstr. 5, D-52074 Aachen, Germany
00009  * phone: ++49-241-80-27910,
00010  * fax: ++49-241-80-22242
00011  * email: info@openwns.org
00012  * www: http://www.openwns.org
00013  * _____________________________________________________________________________
00014  *
00015  * openWNS is free software; you can redistribute it and/or modify it under the
00016  * terms of the GNU Lesser General Public License version 2 as published by the
00017  * Free Software Foundation;
00018  *
00019  * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY
00020  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
00021  * A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00022  * details.
00023  *
00024  * You should have received a copy of the GNU Lesser General Public License
00025  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00026  *
00027  ******************************************************************************/
00028 
00029 #ifndef WIMEMAC_LOWERMAC_TIMING_DCF_HPP
00030 #define WIMEMAC_LOWERMAC_TIMING_DCF_HPP
00031 
00032 #include <WIMEMAC/lowerMAC/timing/Backoff.hpp>
00033 #include <WIMEMAC/convergence/IChannelState.hpp>
00034 #include <WIMEMAC/convergence/IRxStartEnd.hpp>
00035 #include <WIMEMAC/drp/IDRPSchedulerServices.hpp>
00036 
00037 #include <WNS/ldk/fu/Plain.hpp>
00038 #include <WNS/ldk/Command.hpp>
00039 
00040 //  //
00041 namespace wimemac { namespace drp {
00042         class DRPScheduler;
00043 }}
00044 
00045 namespace wimemac { namespace lowerMAC { namespace timing {
00046 
00058     class DCF:
00059         public wns::ldk::fu::Plain<DCF, wns::ldk::EmptyCommand>,
00060         public virtual BackoffObserver
00061     {
00062 
00063     public:
00064 
00065         DCF(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00066 
00067         virtual
00068         ~DCF();
00069 
00071         void doSendData(const wns::ldk::CompoundPtr& compound);
00072         void doOnData(const wns::ldk::CompoundPtr& compound);
00073         bool doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00074         void doWakeup();
00075 
00076         virtual void onFUNCreated();
00077 
00079         void
00080         registerEOBObserver(BackoffObserver* observer) {backoff.registerEOBObserver(observer);}
00081 
00084         wns::simulator::Time
00085         backoffFinishedAt() {return backoff.finishedAt();}
00086 
00088         void onDRPStart();
00089         void onDRPStop();
00090 
00091         void waitingTransmissions(int numTransmissions);
00092 
00093     private:
00094 
00096         virtual void backoffExpired();
00097 
00098         const std::string csName;
00099         const std::string rxStartEndName;
00100         const std::string drpSchedulerName;
00101         const bool backoffDisabled;
00102 
00104         mutable Backoff backoff;
00105 
00107         mutable bool sendNow;
00108 
00109         struct Friends
00110         {
00111             wimemac::drp::IDRPSchedulerServices* drpScheduler;
00112         } friends;
00113 
00114         wns::logger::Logger logger;
00115     };
00116 } // timing
00117 } // lowerMAC
00118 } // wimemac
00119 
00120 #endif // WIMEMAC_LOWERMAC_TIMING_DCF_HPP

Generated on Sun May 27 03:32:11 2012 for openWNS by  doxygen 1.5.5