User Manual, Developers Guide and API Documentation

SequentlyCallingLinkHandler.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_SEQUENTLYCALLINGLINKHANDLER_HPP
00029 #define WNS_LDK_SEQUENTLYCALLINGLINKHANDLER_HPP
00030 
00031 #include <WNS/ldk/LinkHandlerInterface.hpp>
00032 #include <WNS/ldk/Compound.hpp>
00033 
00034 #include <WNS/pyconfig/View.hpp>
00035 #include <WNS/logger/Logger.hpp>
00036 
00037 #include <list>
00038 
00039 namespace wns { namespace ldk {
00040 
00041     class FunctionalUnit;
00042 
00043     class SequentlyCallingLinkHandler :
00044         virtual public LinkHandlerInterface
00045     {
00046         struct FUCompound
00047         {
00048             FUCompound() :
00049                 fu(NULL),
00050                 compound(wns::ldk::CompoundPtr())
00051             {} // FUCompound
00052 
00053             FUCompound(FunctionalUnit* _fu, const CompoundPtr& _compound) :
00054                 fu(_fu),
00055                 compound(_compound)
00056             {} // FUCompound
00057 
00058             FunctionalUnit* fu;
00059             CompoundPtr compound;
00060         };
00061 
00062         typedef std::list<FUCompound> FUCompoundContainer;
00063         typedef std::list<FunctionalUnit*> FUContainer;
00064 
00065     public:
00066         SequentlyCallingLinkHandler(const wns::pyconfig::View& _config);
00067 
00068         virtual bool
00069         isAcceptingForwarded(FunctionalUnit* fu, const CompoundPtr& compound);
00070 
00071         virtual void
00072         sendDataForwarded(FunctionalUnit* fu, const CompoundPtr& compound);
00073 
00074         virtual void
00075         wakeupForwarded(FunctionalUnit* fu);
00076 
00077         virtual void
00078         onDataForwarded(FunctionalUnit* fu, const CompoundPtr& compound);
00079 
00080     private:
00081         void
00082         sendDataHandler(FunctionalUnit* fu, const CompoundPtr& compound);
00083 
00084         void
00085         wakeupHandler(FunctionalUnit* fu);
00086 
00087         void
00088         onDataHandler(FunctionalUnit* fu, const CompoundPtr& compound);
00089 
00090         void
00091         mainHandler();
00092 
00093         bool inAction;
00094 
00095         FUContainer pendingCompoundsContainingFUs;
00096 
00097         int sendDataPending;
00098         FUCompound sendDataFUCompound;
00099 
00100         FUContainer wakeupFUs;
00101         bool inWakeup;
00102         FUContainer wakeupFUsInWakeup;
00103 
00104         FUCompoundContainer onDataFUCompounds;
00105 
00106         bool traceCompoundJourney;
00107 
00108         wns::logger::Logger isAcceptingLogger;
00109         wns::logger::Logger sendDataLogger;
00110         wns::logger::Logger wakeupLogger;
00111         wns::logger::Logger onDataLogger;
00112     };
00113 
00114 } // ldk
00115 } // wns
00116 
00117 #endif // NOT defined WNS_LDK_SEQUENTLYCALLINGLINKHANDLER_HPP
00118 
00119 

Generated on Fri May 25 03:31:46 2012 for openWNS by  doxygen 1.5.5