![]() |
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-2009 00006 * Chair of Communication Networks (ComNets) 00007 * Kopernikusstr. 5, D-52074 Aachen, Germany 00008 * email: info@openwns.org 00009 * www: http://www.openwns.org 00010 * _____________________________________________________________________________ 00011 * 00012 * openWNS is free software; you can redistribute it and/or modify it under the 00013 * terms of the GNU Lesser General Public License version 2 as published by the 00014 * Free Software Foundation; 00015 * 00016 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00017 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00018 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00019 * details. 00020 * 00021 * You should have received a copy of the GNU Lesser General Public License 00022 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00023 * 00024 ******************************************************************************/ 00025 00026 00027 #ifndef WIMAC_CONNECTIONKEY_H 00028 #define WIMAC_CONNECTIONKEY_H 00029 00030 #include <string> 00031 #include <sstream> 00032 00033 #include <WNS/SmartPtr.hpp> 00034 #include <WNS/ldk/Key.hpp> 00035 00036 namespace wns { namespace ldk { 00037 00038 class Layer; 00039 class Compound; 00040 00041 }} 00042 namespace wimac { 00043 00044 class CIDKeyBuilder; 00045 class ConnectionClassifier; 00046 00050 class ConnectionKey : 00051 public wns::ldk::Key 00052 { 00053 public: 00054 ConnectionKey( const CIDKeyBuilder* builder, const wns::ldk::CompoundPtr compound, 00055 int direction ); 00056 00057 // used by Handover.hpp 00058 ConnectionKey( int cid ) 00059 { 00060 id = cid; 00061 } 00062 00063 bool operator<(const wns::ldk::Key& other) const; 00064 std::string str() const; 00065 00066 private: 00067 int id; 00068 }; 00069 00073 class CIDKeyBuilder : 00074 public wns::ldk::KeyBuilder 00075 { 00076 public: 00077 CIDKeyBuilder( const wns::ldk::fun::FUN* fun, const wns::pyconfig::View& ) : 00078 fun_(fun) {} 00079 00080 void onFUNCreated(); 00081 00082 virtual wns::ldk::ConstKeyPtr 00083 operator() (const wns::ldk::CompoundPtr& compound, int direction ) const 00084 { 00085 return wns::ldk::ConstKeyPtr(new ConnectionKey( this, compound, direction )); 00086 } 00087 00088 const wns::ldk::fun::FUN* fun_; 00089 struct Friends { 00090 ConnectionClassifier* classifier_; 00091 } friends; 00092 }; 00093 00094 } 00095 00096 #endif 00097
1.5.5