User Manual, Developers Guide and API Documentation

Buffer.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-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 WIFIMAC_LOWERMAC_BUFFER_HPP
00029 #define WIFIMAC_LOWERMAC_BUFFER_HPP
00030 
00031 #include <WIFIMAC/lowerMAC/Manager.hpp>
00032 #include <WIFIMAC/lowerMAC/ITXOPWindow.hpp>
00033 #include <WIFIMAC/lowerMAC/RateAdaptation.hpp>
00034 #include <WIFIMAC/management/ProtocolCalculator.hpp>
00035 
00036 #include <WNS/ldk/buffer/Dropping.hpp>
00037 
00038 #include <list>
00039 #include <memory>
00040 
00041 namespace wifimac { namespace lowerMAC {
00042 
00053     class Buffer :
00054         public wns::ldk::buffer::Buffer,
00055         public wns::ldk::fu::Plain<Buffer>,
00056         public wns::ldk::Delayed<Buffer>,
00057         public wifimac::lowerMAC::ITXOPWindow
00058     {
00059         typedef unsigned long int PDUCounter;
00060 
00061     public:
00062 
00066         Buffer(wns::ldk::fun::FUN* fuNet, const wns::pyconfig::View& config);
00067 
00071         Buffer(const Buffer& other);
00072 
00076         virtual
00077         ~Buffer();
00078 
00082         virtual void
00083         processIncoming(const wns::ldk::CompoundPtr& compound);
00084 
00088         virtual bool
00089         hasCapacity() const;
00090 
00097         virtual void
00098         processOutgoing(const wns::ldk::CompoundPtr& compound);
00099 
00107         virtual const wns::ldk::CompoundPtr
00108         hasSomethingToSend() const;
00109 
00116         virtual wns::ldk::CompoundPtr
00117         getSomethingToSend();
00118 
00120         virtual unsigned long int
00121         getSize();
00122 
00124         virtual unsigned long int
00125         getMaxSize();
00126 
00127 
00129         virtual wns::simulator::Time
00130         getNextTransmissionDuration();
00131 
00133         virtual wns::service::dll::UnicastAddress
00134         getNextReceiver() const;
00135     protected:
00136         wns::ldk::buffer::dropping::ContainerType buffer;
00137 
00138     private:
00139         void onFUNCreated();
00140             void checkLifetime();
00141 
00142         unsigned long int maxSize;
00143         unsigned long int currentSize;
00144         bool isActive;
00145         std::auto_ptr<wns::ldk::buffer::SizeCalculator> sizeCalculator;
00146         std::auto_ptr<wns::ldk::buffer::dropping::Drop> dropper;
00147 
00148         PDUCounter totalPDUs;
00149         PDUCounter droppedPDUs;
00150 
00151         const std::string raName;
00152         const std::string protocolCalculatorName;
00153         const std::string managerName;
00154         wifimac::management::ProtocolCalculator* protocolCalculator;
00155 
00156         struct Friends
00157         {
00158             wifimac::lowerMAC::RateAdaptation* ra;
00159             wifimac::lowerMAC::Manager* manager;
00160         } friends;
00161 
00162         wns::logger::Logger logger;
00163     };
00164 
00165 }}
00166 
00167 
00168 #endif // NOT defined WIFIMAC_LOWERMAC_BUFFER_HPP
00169 
00170 

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