![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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_MULTIPLEXER_FRAMEDISPATCHER_HPP 00029 #define WNS_LDK_MULTIPLEXER_FRAMEDISPATCHER_HPP 00030 00031 #include <WNS/ldk/CommandTypeSpecifier.hpp> 00032 #include <WNS/ldk/HasReceptor.hpp> 00033 #include <WNS/ldk/HasConnector.hpp> 00034 #include <WNS/ldk/HasDeliverer.hpp> 00035 #include <WNS/ldk/Processor.hpp> 00036 00037 #include <WNS/ldk/RoundRobinReceptor.hpp> 00038 #include <WNS/ldk/RoundRobinConnector.hpp> 00039 00040 #include <WNS/ldk/fun/FUN.hpp> 00041 00042 #include <WNS/ldk/multiplexer/OpcodeProvider.hpp> 00043 #include <WNS/ldk/multiplexer/OpcodeDeliverer.hpp> 00044 00045 namespace wns { namespace ldk { namespace multiplexer { 00046 00082 class FrameDispatcher : 00083 public CommandTypeSpecifier<OpcodeCommand>, 00084 public HasReceptor<RoundRobinReceptor>, 00085 public HasConnector<RoundRobinConnector>, 00086 public HasDeliverer<OpcodeDeliverer>, 00087 public Processor<FrameDispatcher>, 00088 public Cloneable<FrameDispatcher> 00089 { 00090 public: 00095 FrameDispatcher(fun::FUN* fuNet, const pyconfig::View& _config); 00096 00097 // processor interface 00098 virtual void processOutgoing(const CompoundPtr& compound); 00099 virtual void processIncoming(const CompoundPtr& compound); 00100 00101 virtual void calculateSizes(const CommandPool* commandPool, Bit& commandPoolSize, Bit& sduSize) const; 00102 00103 int getOpcodeSize() const { return opcodeSize; } 00104 00105 // connection setup modification 00106 virtual FunctionalUnit* whenConnecting(); 00107 00108 private: 00109 virtual void doDownConnect(FunctionalUnit* that, const std::string& srcPort, const std::string& dstPort); 00110 virtual void doUpConnect(FunctionalUnit* that, const std::string& srcPort, const std::string& dstPort); 00111 00112 pyconfig::View config; 00113 00114 int opcodeSize; 00115 int opcode; 00116 00117 FunctionalUnit* pending; 00118 bool upConnected; 00119 bool downConnected; 00120 00121 logger::Logger logger; 00122 }; 00123 }}} 00124 00125 #endif // NOT defined WNS_LDK_MULTIPLEXER_FRAMEDISPATCHER_HPP 00126 00127
1.5.5