User Manual, Developers Guide and API Documentation

FlowHandler.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 LTE_CONTROLPLANE_FLOWMANAGEMENT_FLOWHANDLER_FLOWHANDLER_HPP
00029 #define LTE_CONTROLPLANE_FLOWMANAGEMENT_FLOWHANDLER_FLOWHANDLER_HPP
00030 
00031 #include <LTE/helper/HasModeName.hpp>
00032 #include <LTE/helper/TransactionID.hpp>
00033 
00034 #include <DLL/Layer2.hpp>
00035 #include <DLL/services/control/Association.hpp>
00036 #include <DLL/StationManager.hpp>
00037 
00038 #include <WNS/ldk/CommandTypeSpecifier.hpp>
00039 #include <WNS/ldk/HasReceptor.hpp>
00040 #include <WNS/ldk/HasConnector.hpp>
00041 #include <WNS/ldk/HasDeliverer.hpp>
00042 #include <WNS/ldk/Compound.hpp>
00043 #include <WNS/ldk/Command.hpp>
00044 #include <WNS/ldk/FlowGate.hpp>
00045 #include <WNS/ldk/FUNConfigCreator.hpp>
00046 #include <WNS/logger/Logger.hpp>
00047 #include <WNS/service/dll/Address.hpp>
00048 #include <WNS/service/dll/FlowID.hpp>
00049 #include <WNS/service/qos/QoSClasses.hpp>
00050 #include <WNS/Enum.hpp>
00051 #include <WNS/pyconfig/View.hpp>
00052 #include <WNS/Subject.hpp>
00053 
00054 namespace lte {
00055 
00056     namespace macg {
00057         class MACg;
00058     }
00059     namespace rlc {
00060         class RLC;
00061     }
00062 
00063     namespace controlplane{
00064 
00065         namespace flowmanagement {
00066             class FlowManager;
00067 
00068             namespace flowhandler {
00069 
00070                 ENUM_BEGIN(CompoundType);
00071                 ENUM(flow_req,       0);
00072                 ENUM(flow_confirm,   1);
00073                 ENUM(flow_ack,       2);
00074                 ENUM(flow_rel,       3);
00075                 ENUM(flow_rel_ack,   4);
00076                 ENUM_END();
00077 
00079                 class FlowHandlerCommand :
00080                     public wns::ldk::Command
00081                 {
00082                 public:
00084                     typedef int CompoundType;
00085 
00086                     FlowHandlerCommand() {
00087                     };
00088 
00089                     struct {
00090                     } local;
00091 
00092                     struct {
00093                         CompoundType myCompoundType;
00094                         wns::service::dll::FlowID flowID;
00095                         wns::service::dll::UnicastAddress user;
00096                         lte::helper::TransactionID transactionId;
00097                         bool preserved;
00098                         wns::service::dll::FlowID oldFlowID;
00099                         wns::service::qos::QoSClass qosClass;
00100                     } peer;
00101 
00102                     struct {
00103                     } magic;
00104                 };
00105 
00106                 class FlowHandler :
00107                     virtual public wns::ldk::FunctionalUnit,
00108                     public wns::ldk::CommandTypeSpecifier<FlowHandlerCommand>,
00109                     public wns::ldk::HasConnector<>,
00110                     public wns::ldk::HasReceptor<>,
00111                     public wns::ldk::HasDeliverer<>,
00112                     public lte::helper::HasModeName,
00113                     public dll::services::control::AssociationObserver
00114 
00115                 {
00116                 public:
00118                     FlowHandler(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00119 
00121                     virtual ~FlowHandler();
00122 
00123                     virtual void
00124                     onFUNCreated();
00125 
00126                     virtual bool
00127                     doIsAccepting(const wns::ldk::CompoundPtr& compound ) const;
00128 
00129                     void
00130                     doSendData(const wns::ldk::CompoundPtr& /* compound */);
00131 
00132                     void
00133                     doWakeup();
00134 
00135                     void
00136                     calculateSizes(const wns::ldk::CommandPool* commandPool,
00137                                    Bit& commandPoolSize,
00138                                    Bit& dataSize) const;
00139 
00140                     virtual void
00141                     createFlow(wns::service::dll::FlowID){}
00142 
00143                     virtual void
00144                     destroyFlow(wns::service::dll::FlowID);
00145 
00146                     void
00147                     closeFlow(wns::service::dll::FlowID flowID);
00148 
00150                     virtual void onAssociated(wns::service::dll::UnicastAddress userAdr, wns::service::dll::UnicastAddress dstAdr);
00152                     virtual void onDisassociated(wns::service::dll::UnicastAddress userAdr, wns::service::dll::UnicastAddress dstAdr);
00153 
00154                 protected:
00155                     wns::ldk::fun::FUN* fun;
00156                     dll::ILayer2* layer2;
00157 
00158                     lte::macg::MACg* macg;
00159             wns::ldk::CommandReaderInterface* rlcReader;
00160                     lte::controlplane::flowmanagement::FlowManager* flowManager;
00161                     dll::services::control::Association* associationService;
00162                     wns::logger::Logger logger;
00163                     Bit commandSize;
00164                     wns::ldk::FlowGate* lowerFlowGate;
00165                     std::list<std::string> flowSeparatorNames;
00166                     std::list<wns::ldk::FlowSeparator*> flowSeparators;
00167                 };
00168             }
00169         }
00170     }
00171 }
00172 #endif // LTE_CONTROLPLANE_FLOWMANAGEMENT__FLOWHANDLER_FLOWHANDLER_HPP

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