![]() |
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 #ifndef WNS_LDK_FCF_TIMINGCONTROL_H 00028 #define WNS_LDK_FCF_TIMINGCONTROL_H 00029 00030 #include <WNS/ldk/ldk.hpp> 00031 #include <WNS/ldk/fcf/PhaseDescriptor.hpp> 00032 #include <WNS/ldk/fcf/FrameBuilderConfigCreator.hpp> 00033 #include <WNS/events/PeriodicTimeout.hpp> 00034 #include <WNS/logger/Logger.hpp> 00035 00036 #include <list> 00037 00038 namespace wns { namespace ldk { namespace fcf { 00039 00040 class CompoundCollectorInterface; 00041 class FrameBuilder; 00042 00048 class TimingControlInterface 00049 { 00050 public: 00051 virtual ~TimingControlInterface() {} 00052 00056 virtual void configure() = 0; 00057 00061 virtual void start() = 0; 00062 00066 virtual void pause() = 0; 00067 00071 virtual void stop() = 0; 00072 00076 //virtual int getRole(PhaseDescriptorPtr p) = 0; 00077 00078 virtual FrameBuilder* getFrameBuilder() const = 0; 00079 00084 virtual void finishedPhase(CompoundCollectorInterface* collector) = 0; 00085 }; 00086 00087 00097 class TimingControl : 00098 public virtual TimingControlInterface, 00099 public wns::events::PeriodicTimeout 00100 { 00101 public: 00102 typedef std::list<CompoundCollectorInterface*> CompoundCollectors; 00103 00104 TimingControl( FrameBuilder* frameBuilder, const pyconfig::View& config ); 00105 00106 void onFUNCreated(); 00107 00108 virtual void nextPhase(); 00109 00110 virtual void configure(); 00111 00112 virtual void start(); 00113 00114 virtual void pause(); 00115 00116 virtual void stop(); 00117 00118 virtual int getRole(PhaseDescriptorPtr p); 00119 00120 void periodically(); 00121 00122 virtual void finishedPhase( CompoundCollectorInterface* ) 00123 { 00124 nextPhase(); 00125 } 00126 00127 virtual FrameBuilder* getFrameBuilder() const 00128 { 00129 return frameBuilder; 00130 } 00131 00132 00133 private: 00134 CompoundCollectors compoundCollectors; 00135 CompoundCollectors::iterator activeCC; 00136 FrameBuilder* frameBuilder; 00137 wns::logger::Logger logger; 00138 bool running; 00139 }; 00140 00141 typedef FrameBuilderConfigCreator<TimingControlInterface> TimingControlCreator; 00142 typedef wns::StaticFactory<TimingControlCreator> TimingControlFactory; 00143 00144 }}} 00145 #endif 00146
1.5.5