User Manual, Developers Guide and API Documentation

ConstantDelay.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 WNS_LDK_TOOLS_CONSTANTDELAY_HPP
00029 #define WNS_LDK_TOOLS_CONSTANTDELAY_HPP
00030 
00031 #include <WNS/ldk/fu/Plain.hpp>
00032 #include <WNS/ldk/Delayed.hpp>
00033 #include <WNS/ldk/Command.hpp>
00034 
00035 #include <WNS/logger/Logger.hpp>
00036 #include <WNS/simulator/Time.hpp>
00037 #include <WNS/events/CanTimeout.hpp>
00038 
00039 namespace wns { namespace ldk { namespace tools {
00040 
00044     class ConstantDelay:
00045         public wns::ldk::fu::Plain<ConstantDelay, wns::ldk::EmptyCommand>,
00046         public wns::ldk::Delayed<ConstantDelay>,
00047         public wns::events::CanTimeout
00048     {
00049     public:
00053         ConstantDelay(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00054 
00056         virtual void
00057         processIncoming(const wns::ldk::CompoundPtr& compound);
00058 
00060         virtual void
00061         processOutgoing(const wns::ldk::CompoundPtr& compound);
00062 
00064         virtual bool
00065         hasCapacity() const;
00066 
00068         virtual const wns::ldk::CompoundPtr
00069         hasSomethingToSend() const;
00070 
00072         virtual wns::ldk::CompoundPtr
00073         getSomethingToSend();
00074 
00076         virtual void
00077         onTimeout();
00078 
00079     private:
00081         wns::ldk::CompoundPtr currentFrame;
00082 
00084         const wns::simulator::Time delay;
00085 
00086         wns::logger::Logger logger;
00087     };
00088 
00089 } // tools
00090 } // ldk
00091 } // wns
00092 
00093 #endif // NOT defined WNS_LDK_TOOLS_CONSTANTDELAY_HPP
00094 
00095 

Generated on Tue May 22 03:31:43 2012 for openWNS by  doxygen 1.5.5