![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /****************************************************************************** 00002 * WiFiMAC (IEEE 802.11) * 00003 * This file is part of openWNS (open Wireless Network Simulator) 00004 * _____________________________________________________________________________ 00005 * 00006 * Copyright (C) 2004-2007 00007 * Chair of Communication Networks (ComNets) 00008 * Kopernikusstr. 16, D-52074 Aachen, Germany 00009 * phone: ++49-241-80-27910, 00010 * fax: ++49-241-80-22242 00011 * email: info@openwns.org 00012 * www: http://www.openwns.org 00013 * _____________________________________________________________________________ 00014 * 00015 * openWNS is free software; you can redistribute it and/or modify it under the 00016 * terms of the GNU Lesser General Public License version 2 as published by the 00017 * Free Software Foundation; 00018 * 00019 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00020 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00021 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00022 * details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public License 00025 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00026 * 00027 ******************************************************************************/ 00028 00029 #ifndef WIMAC_HELPER_CONTEXTPROVIDER_HPP 00030 #define WIMAC_HELPER_CONTEXTPROVIDER_HPP 00031 00032 #include <WNS/probe/bus/CommandContextProvider.hpp> 00033 #include <WIMAC/UpperConvergence.hpp> 00034 #include <WIMAC/Component.hpp> 00035 00036 #include <boost/function.hpp> 00037 00038 namespace wimac { namespace helper { namespace contextprovider { 00039 00044 class SourceAddress: 00045 virtual public wns::probe::bus::CommandContextProvider<wimac::UpperCommand> 00046 { 00047 public: 00048 SourceAddress(wns::ldk::fun::FUN* fun, std::string ucCommandName); 00049 00050 virtual 00051 ~SourceAddress(); 00052 00053 private: 00054 virtual void 00055 doVisitCommand(wns::probe::bus::IContext& c, const wimac::UpperCommand* command) const; 00056 }; 00057 00062 class TargetAddress: 00063 virtual public wns::probe::bus::CommandContextProvider<wimac::UpperCommand> 00064 { 00065 public: 00066 TargetAddress(wns::ldk::fun::FUN* fun, std::string ucCommandName); 00067 00068 virtual 00069 ~TargetAddress(); 00070 00071 private: 00072 virtual void 00073 doVisitCommand(wns::probe::bus::IContext& c, const wimac::UpperCommand* command) const; 00074 }; 00075 00076 class CallbackCommandContextProvider 00077 : virtual public wns::probe::bus::CommandContextProvider<wimac::UpperCommand> 00078 { 00079 public: 00080 CallbackCommandContextProvider(wns::ldk::fun::FUN* fun, 00081 std::string ucCommandName, 00082 const std::string& key, 00083 boost::function1<int, wimac::Component*> callback); 00084 00085 private: 00086 virtual void 00087 doVisitCommand(wns::probe::bus::IContext& c, const wimac::UpperCommand* command) const; 00088 00089 boost::function1<int, wimac::Component*> callback_; 00090 }; 00091 00092 }}} 00093 00094 #endif // WIMAC_HELPER_CONTEXTPROVIDER_HPP
1.5.5