![]() |
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 RISE_MANAGER_SYSTEMMANAGER_HPP 00029 #define RISE_MANAGER_SYSTEMMANAGER_HPP 00030 00031 #include <RISE/misc/RISELogger.hpp> 00032 #include <RISE/stations/station.hpp> 00033 00034 #include <WNS/pyconfig/View.hpp> 00035 #include <WNS/Position.hpp> 00036 #include <WNS/geometry/Vector.hpp> 00037 00038 #include <string> 00039 #include <vector> 00040 #include <map> 00041 #include <algorithm> 00042 00043 namespace rise { 00044 namespace scenario { 00045 class Scenario; 00046 } 00047 class Mobile; 00048 class Station; 00058 class SystemManager { 00059 public: 00067 typedef std::vector<Station*> StationContainer; 00068 00076 typedef std::vector<wns::geometry::Vector> WraparoundShiftVectorContainer; 00077 00086 typedef StationContainer::iterator StationIterator; 00087 00096 SystemManager(const std::string &aSystemName, 00097 const wns::pyconfig::View& config); 00098 00105 virtual ~SystemManager(); 00106 00112 wns::pyconfig::View 00113 getConfigFile() const; 00114 00118 const WraparoundShiftVectorContainer* 00119 getWraparoundShiftVectors() const; 00120 00121 00130 Station* getStation(unsigned long int i) const { 00131 return stations.at(i); 00132 }; 00133 00139 unsigned long int getNumStations() const { 00140 return stations.size(); 00141 }; 00142 00152 StationContainer getAllStations() const; 00153 00183 template<class F> F forEachStation(F f) { 00184 assert(!stations.empty()); 00185 return std::for_each(stations.begin(), stations.end(), f); 00186 } 00187 00191 virtual void createScenario(); 00192 00198 scenario::Scenario* getScenario() const; 00199 00205 std::string getSystemName() const; 00206 00213 void addStation(Station* station); 00214 00215 protected: 00219 std::string systemName; 00220 00229 scenario::Scenario* scenario; 00230 00235 StationContainer stations; 00236 00248 wns::pyconfig::View pyConfigView; 00249 00250 WraparoundShiftVectorContainer wraparoundShiftVector; 00251 00252 private: 00260 int stationId; 00261 00265 RISELogger log; 00266 00270 SystemManager(const SystemManager&); 00271 00275 SystemManager& operator=(const SystemManager&); 00276 }; 00277 } 00278 00279 #endif // NOT defined RISE_MANAGER_SYSTEMMANGER_HPP 00280 00281
1.5.5