![]() |
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 #ifndef WIMAC_STATIONMANAGER_HPP 00026 #define WIMAC_STATIONMANAGER_HPP 00027 00028 #include <cstdlib> 00029 #include <vector> 00030 00031 #include <WNS/logger/Logger.hpp> 00032 #include <WNS/pyconfig/View.hpp> 00033 #include <WNS/Singleton.hpp> 00034 #include <WNS/container/Registry.hpp> 00035 #include <WNS/service/dll/Address.hpp> 00036 00037 namespace wns { namespace node { 00038 class Interface; 00039 }} 00040 00041 namespace wimac { 00042 00043 class Component; 00044 00045 typedef unsigned int StationID; 00046 00059 class StationManager 00060 { 00061 typedef wns::container::Registry<StationID, Component*> LayerLookup; 00062 typedef wns::container::Registry<wns::node::Interface*, Component*> NodeLookup; 00063 typedef wns::container::Registry<wns::service::dll::UnicastAddress, Component*> MACAdrLookup; 00064 00065 public: 00069 void registerStation(StationID id, 00070 wns::service::dll::UnicastAddress adr, 00071 Component* layer); 00072 00075 Component* getStationByMAC(wns::service::dll::UnicastAddress mac) const; 00076 Component* getStationByID(StationID) const; 00077 Component* getStationByNode(wns::node::Interface*) const; 00078 wns::node::Interface* getNodeByID(StationID) const; 00080 00081 private: 00082 MACAdrLookup macAdrLookup; 00083 LayerLookup layerLookup; 00084 NodeLookup nodeLookup; 00085 }; 00086 00087 typedef wns::SingletonHolder<StationManager> TheStationManager; 00088 } 00089 00090 00091 #endif 00092 00093
1.5.5