![]() |
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. 16, 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 WNS_DISTRIBUTION_TIMEDEPENDENT_HPP 00029 #define WNS_DISTRIBUTION_TIMEDEPENDENT_HPP 00030 00031 #include <WNS/pyconfig/View.hpp> 00032 #include <WNS/distribution/Distribution.hpp> 00033 00034 #include <map> 00035 00036 namespace wns { namespace distribution { 00037 00075 class TimeDependent : 00076 virtual public wns::distribution::Distribution 00077 { 00081 class DistributionEvent 00082 { 00083 public: 00084 DistributionEvent(TimeDependent* td, const wns::pyconfig::View& view); 00085 00089 virtual void 00090 operator()(); 00091 00092 const wns::pyconfig::View& 00093 getConfig() { return config_; } 00094 00095 virtual 00096 ~DistributionEvent(); 00097 00098 private: 00102 TimeDependent* target_; 00103 00107 wns::pyconfig::View config_; 00108 }; 00109 00110 typedef std::map<simTimeType, DistributionEvent> EventContainer; 00111 00112 public: 00116 explicit 00117 TimeDependent(const wns::pyconfig::View& view); 00118 00122 explicit 00123 TimeDependent(wns::rng::RNGen* rng, const wns::pyconfig::View& view); 00124 00128 virtual 00129 ~TimeDependent(); 00130 00134 virtual double 00135 operator()(); 00136 00137 virtual std::string 00138 paramString() const; 00139 00140 private: 00144 void 00145 queueNextDistribution(); 00146 00150 void 00151 setDistribution(const wns::pyconfig::View& distConfig); 00152 00156 void 00157 removeDistribution(); 00158 00162 Distribution* distribution_; 00163 00164 void 00165 init(); 00166 00170 EventContainer events_; 00171 00172 wns::pyconfig::View config_; 00173 00174 }; // TimeDependent 00175 00176 } // distribution 00177 } // wns 00178 00179 00180 #endif // WNS_DISTRIBUTION_TIMEDEPENDENT_HPP 00181 00182 00183 /* 00184 Local Variables: 00185 mode: c++ 00186 fill-column: 80 00187 c-basic-offset: 8 00188 c-comment-only-line-offset: 0 00189 c-tab-always-indent: t 00190 indent-tabs-mode: t 00191 tab-width: 8 00192 End: 00193 */
1.5.5