User Manual, Developers Guide and API Documentation

BaseState.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WNS (Wireless Network Simulator)                                           *
00003  * __________________________________________________________________________ *
00004  *                                                                            *
00005  * Copyright (C) 2004-2006                                                    *
00006  * Chair of Communication Networks (ComNets)                                  *
00007  * Kopernikusstr. 16, D-52074 Aachen, Germany                                 *
00008  * phone: ++49-241-80-27910 (phone), fax: ++49-241-80-22242                   *
00009  * email: wns@comnets.rwth-aachen.de                                          *
00010  * www: http://wns.comnets.rwth-aachen.de                                     *
00011  ******************************************************************************/
00012 
00013 #ifndef GLUE_ARQFSM_SELECTIVEREPEAT_BASESTATE_HPP
00014 #define GLUE_ARQFSM_SELECTIVEREPEAT_BASESTATE_HPP
00015 
00016 #include <GLUE/arqfsm/selectiverepeat/FSMFU.hpp>
00017 #include <GLUE/arqfsm/ARQBaseState.hpp>
00018 
00019 #include <WNS/ldk/Compound.hpp>
00020 
00021 namespace glue { namespace arqfsm { namespace selectiverepeat {
00022 
00023     class BaseState :
00024         public ARQBaseState<FSMFU, SelectiveRepeatCommand>
00025     {
00026     public:
00027         BaseState(FSMFU::BaseFSM* t, const std::string& stateName) :
00028             ARQBaseState<FSMFU, SelectiveRepeatCommand>(t, stateName)
00029         {} // BaseState
00030 
00031         virtual
00032         ~BaseState()
00033         {} // ~BaseState
00034 
00035         virtual void
00036         onInitState()
00037         {} // onInitState
00038 
00039         virtual void
00040         onExitState()
00041         {} // onExitState
00042 
00043         virtual StateInterface*
00044         onTimeout(const wns::ldk::CompoundPtr& compound) = 0;
00045 
00046         virtual void
00047         deliverCompounds();
00048 
00049     protected:
00050         virtual void
00051         tryToSendACKs();
00052 
00053         virtual void
00054         tryToSendIs();
00055 
00056     private:
00057         virtual StateInterface*
00058         onI(const wns::ldk::CompoundPtr& compound, int sequenceNumber);
00059 
00060         bool
00061         pendingACK(int sequenceNumber);
00062     };
00063 
00064 } // selectiverepeat
00065 } // arqfsm
00066 } // glue
00067 
00068 #endif // GLUE_ARQFSM_SELECTIVEREPEAT_BASESTATE_HPP
00069 
00070 

Generated on Sun May 27 03:31:58 2012 for openWNS by  doxygen 1.5.5