User Manual, Developers Guide and API Documentation

ISimulator.hpp

Go to the documentation of this file.
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_SIMULATOR_ISIMULATOR_HPP
00029 #define WNS_SIMULATOR_ISIMULATOR_HPP
00030 
00031 #include <WNS/pyconfig/View.hpp>
00032 #include <WNS/container/UntypedRegistry.hpp>
00033 #include <WNS/rng/RNGen.hpp>
00034 
00035 #include <boost/signal.hpp>
00036 
00037 #include <memory>
00038 
00039 namespace wns { namespace events { namespace scheduler {
00040     class Interface;
00041 }}}
00042 
00043 namespace wns { namespace logger {
00044     class Master;
00045 }}
00046 
00047 namespace wns { namespace probe { namespace bus {
00048     class ProbeBusRegistry;
00049 }}}
00050 
00051 namespace wns { namespace simulator {
00052 
00053     typedef boost::signal0<void> ResetSignal;
00054     typedef boost::signal0<void> ShutdownSignal;
00055     typedef wns::container::UntypedRegistry<std::string> Registry;
00056 
00077     class ISimulator
00078     {
00079     public:
00083         virtual
00084         ~ISimulator();
00085 
00089         wns::events::scheduler::Interface*
00090         getEventScheduler() const;
00091 
00095         wns::logger::Master*
00096         getMasterLogger() const;
00097 
00101         wns::rng::RNGen*
00102         getRNG() const;
00103 
00107         wns::pyconfig::View
00108         getConfiguration() const;
00109 
00113         wns::probe::bus::ProbeBusRegistry*
00114         getProbeBusRegistry() const;
00115 
00120         Registry*
00121         getRegistry() const;
00122 
00126         ResetSignal*
00127         getResetSignal() const;
00128 
00132         ShutdownSignal*
00133         getShutdownSignal() const;
00134 
00138         void
00139         reset();
00140 
00141     private:
00145         virtual wns::events::scheduler::Interface*
00146         doGetEventScheduler() const = 0;
00147 
00151         virtual wns::logger::Master*
00152         doGetMasterLogger() const = 0;
00153 
00157         virtual wns::rng::RNGen*
00158         doGetRNG() const = 0;
00159 
00163         virtual wns::pyconfig::View
00164         doGetConfiguration() const = 0;
00165 
00169         virtual wns::probe::bus::ProbeBusRegistry*
00170         doGetProbeBusRegistry() const = 0;
00171 
00175         virtual Registry*
00176         doGetRegistry() const = 0;
00177 
00181         virtual ResetSignal*
00182         doGetResetSignal() const = 0;
00183 
00187         virtual ShutdownSignal*
00188         doGetShutdownSignal() const = 0;
00189 
00193         virtual void
00194         doReset() = 0;
00195     };
00196 
00197 
00203     class Singleton
00204     {
00205     public:
00209         explicit
00210         Singleton();
00211 
00215         virtual
00216         ~Singleton();
00217 
00222         ISimulator*
00223         getInstance();
00224 
00229         void
00230         setInstance(ISimulator* simulator);
00231 
00235         void
00236         shutdownInstance();
00237 
00238     private:
00242         std::auto_ptr<ISimulator> simulator_;
00243     };
00244 
00245     Singleton&
00246     getSingleton();
00247 
00251     ISimulator*
00252     getInstance();
00253 
00257     wns::events::scheduler::Interface*
00258     getEventScheduler();
00259 
00263     wns::logger::Master*
00264     getMasterLogger();
00265 
00269     wns::rng::RNGen*
00270     getRNG();
00271 
00275     wns::probe::bus::ProbeBusRegistry*
00276     getProbeBusRegistry();
00277 
00281     Registry*
00282     getRegistry();
00283 
00287     wns::pyconfig::View
00288     getConfiguration();
00289 
00293     ResetSignal*
00294     getResetSignal();
00295 
00299     ShutdownSignal*
00300     getShutdownSignal();
00301 
00302 } // namespace simulator
00303 } // namesapce wns
00304 
00305 
00306 #endif // NOT defined WNS_SIMULATOR_ISIMULATOR_HPP

Generated on Thu May 24 03:31:52 2012 for openWNS by  doxygen 1.5.5