User Manual, Developers Guide and API Documentation

Aloha.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Glue                                                                       *
00003  * __________________________________________________________________________ *
00004  *                                                                            *
00005  * Copyright (C) 2005-2006                                                    *
00006  * Lehrstuhl fuer Kommunikationsnetze (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_MAC_CSMACA_HPP
00014 #define GLUE_MAC_CSMACA_HPP
00015 
00016 #include <WNS/ldk/FunctionalUnit.hpp>
00017 #include <WNS/ldk/CommandTypeSpecifier.hpp>
00018 #include <WNS/ldk/Command.hpp>
00019 #include <WNS/ldk/HasReceptor.hpp>
00020 #include <WNS/ldk/HasConnector.hpp>
00021 #include <WNS/ldk/HasDeliverer.hpp>
00022 #include <WNS/logger/Logger.hpp>
00023 #include <WNS/Cloneable.hpp>
00024 #include <WNS/simulator/Time.hpp>
00025 #include <WNS/distribution/Uniform.hpp>
00026 
00027 namespace glue {
00028 
00029     class AlohaCommand :
00030         public wns::ldk::Command
00031     {
00032     public:
00033         struct {
00034         } local;
00035 
00036         struct {
00037         } peer;
00038 
00039         struct {
00040         } magic;
00041     };
00042 
00043     class Aloha :
00044         public wns::ldk::FunctionalUnit,
00045         public wns::ldk::CommandTypeSpecifier<AlohaCommand>,
00046         public wns::ldk::HasReceptor<>,
00047         public wns::ldk::HasConnector<>,
00048         public wns::ldk::HasDeliverer<>,
00049         public wns::Cloneable<Aloha>
00050     {
00051     public:
00052 
00053         Aloha(wns::ldk::fun::FUN* fun, const wns::pyconfig::View& config);
00054 
00055         virtual
00056         ~Aloha();
00057 
00058     private:
00059         // FunctionalUnit / CompoundHandlerInterface
00060         virtual bool
00061         doIsAccepting(const wns::ldk::CompoundPtr& compound) const;
00062 
00063         virtual void
00064         doSendData(const wns::ldk::CompoundPtr& compound);
00065 
00066         virtual void
00067         doWakeup();
00068 
00069         virtual void
00070         doOnData(const wns::ldk::CompoundPtr& compound);
00071 
00072         virtual void
00073         allowTransmissionAfterElapsedBackoff();
00074 
00075         wns::logger::Logger logger;
00076 
00077                 bool allowTransmission;
00078 
00079         wns::simulator::Time maxWait;
00080 
00081         wns::distribution::Uniform uniform;
00082     };
00083 
00084 }
00085 
00086 #endif // GLUE_MAC_CSMACA_HPP

Generated on Mon May 21 03:32:02 2012 for openWNS by  doxygen 1.5.5