![]() |
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 #include <WIMAC/ConnectionKey.hpp> 00027 00028 #include <WNS/ldk/Classifier.hpp> 00029 #include <WNS/ldk/Layer.hpp> 00030 00031 #include <WIMAC/Classifier.hpp> 00032 #include <WIMAC/Component.hpp> 00033 #include <WIMAC/ConnectionIdentifier.hpp> 00034 #include <WIMAC/services/ConnectionManager.hpp> 00035 00036 using namespace wimac; 00037 00038 STATIC_FACTORY_REGISTER_WITH_CREATOR(CIDKeyBuilder, wns::ldk::KeyBuilder, 00039 "wimac.CIDKeyBuilder", 00040 wns::ldk::FUNConfigCreator); 00041 00042 ConnectionKey::ConnectionKey 00043 ( 00044 const CIDKeyBuilder* builder, 00045 const wns::ldk::CompoundPtr compound, 00046 int 00047 ) 00048 { 00049 wns::ldk::CommandPool* commandPool = compound->getCommandPool(); 00050 wns::ldk::ClassifierCommand* command = 00051 builder->friends.classifier_->getCommand(commandPool); 00052 id = command->peer.id; 00053 } 00054 00055 std::string ConnectionKey::str() const 00056 { 00057 std::stringstream ss; 00058 ss << "CID: " << id; 00059 return ss.str(); 00060 } 00061 00062 bool ConnectionKey::operator<( const wns::ldk::Key& other ) const 00063 { 00064 assure( typeid( other ) == typeid( ConnectionKey ), 00065 "comparing different key types"); 00066 const ConnectionKey* otherID = static_cast<const ConnectionKey*>(&other); 00067 return id < otherID->id; 00068 } 00069 00070 void CIDKeyBuilder::onFUNCreated() 00071 { 00072 friends.classifier_ = 00073 fun_->findFriend<ConnectionClassifier*>("classifier"); 00074 } 00075
1.5.5