User Manual, Developers Guide and API Documentation

DataCollector.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-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 
00026 #ifndef WIMAC_FRAME_DATACOLLECTOR_HPP
00027 #define WIMAC_FRAME_DATACOLLECTOR_HPP
00028 
00029 #include <WNS/ldk/fcf/CompoundCollector.hpp>
00030 #include <WIMAC/PhyUser.hpp>
00031 
00032 namespace wimac {
00033     namespace scheduler {
00034         class Interface;
00035         class Scheduler;
00036     }
00037 }
00038 
00039 namespace wimac {
00040     namespace frame {
00041 
00045         class DataCollector :
00046             public wns::ldk::fcf::CompoundCollector,
00047             public wns::ldk::CommandTypeSpecifier<wns::ldk::EmptyCommand>,
00048             public wns::ldk::HasConnector<>,
00049             public wns::ldk::HasReceptor<>,
00050             public wns::ldk::HasDeliverer<>,
00051             public wns::Cloneable<DataCollector>,
00052             public wns::events::CanTimeout
00053         {
00054         public:
00055             DataCollector(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& view);
00056             DataCollector(const DataCollector& rhs);
00057 
00058             // CompoundHandler interface
00059             void onFUNCreated();
00060             void doSendData(const wns::ldk::CompoundPtr&);
00061             void doOnData(const wns::ldk::CompoundPtr&);
00062             bool doIsAccepting(const wns::ldk::CompoundPtr&) const;
00063 
00064             // CompoundCollector interface
00065             void doStartCollection(int);
00066             void finishCollection();
00067             void doStart(int);
00068             wns::simulator::Time getCurrentDuration() const;
00069 
00070             // CanTimeout interface
00071             void onTimeout();
00072 
00073             wimac::scheduler::Interface* getTxScheduler() const
00074             {
00075                 return txScheduler.get();
00076             }
00077 
00078             wimac::scheduler::Interface* getRxScheduler() const
00079             {
00080                 return rxScheduler.get();
00081             }
00082 
00083             void
00084             deliverReceived();
00085 
00086         private:
00087 
00088             wimac::scheduler::Interface*
00089             getCurrentScheduler() const;
00090 
00091             wns::events::scheduler::IEventPtr deliverReceivedEvent;
00092 
00093             std::auto_ptr<wimac::scheduler::Interface> txScheduler;
00094             std::auto_ptr<wimac::scheduler::Interface> rxScheduler;
00095 
00096             wimac::PhyUser* phyUser_;
00097 
00098             /* For HARQ */
00099             wimac::scheduler::Interface* otherTXScheduler;
00100         };
00101     }
00102 }
00103 #endif

Generated on Sun May 27 03:32:13 2012 for openWNS by  doxygen 1.5.5