User Manual, Developers Guide and API Documentation

Component.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 
00027 #ifndef WIMAC_COMPONENT_HPP
00028 #define WIMAC_COMPONENT_HPP
00029 #include <WNS/node/component/Component.hpp>
00030 #include <WNS/ldk/Layer.hpp>
00031 #include <WNS/service/phy/ofdma/DataTransmission.hpp>
00032 #include <WNS/probe/bus/ContextProvider.hpp>
00033 #include <WNS/probe/bus/ContextProviderCollection.hpp>
00034 #include <WNS/service/dll/DataTransmission.hpp>
00035 #include <WNS/ldk/fun/Main.hpp>
00036 
00037 #include <WIMAC/ConnectionIdentifier.hpp>
00038 
00039 
00040 namespace wimac {
00041 
00042     namespace service {
00043         class ControlPlaneManagerInterface;
00044         class ConnectionManager;
00045     }
00046 
00047     class FunctionalUnit;
00048     class CommandProxy;
00049 
00050     class StationType
00051     {
00052     public:
00053         enum {
00054             AP,
00055             FRS,
00056             UT,
00057             RT
00058         };
00059 
00060         static std::string toString(int type)
00061         {
00062             switch (type)
00063             {
00064             case AP:
00065                 return "AP";
00066             case FRS:
00067                 return "FRS";
00068             case UT:
00069                 return "UT";
00070             case RT:
00071                 return "RT";
00072             default:
00073                 wns::Exception e("Unknown station type with id: ");
00074                 e << type;
00075                 throw e;
00076             }
00077         }
00078     };
00079 
00084     class Component:
00085         public wns::node::component::Component,
00086         public wns::ldk::Layer,
00087         public wns::probe::bus::ContextProvider
00088     {
00089     public:
00090         typedef ConnectionIdentifier::StationID StationID;
00091         typedef ConnectionIdentifier::QoSCategory QoSCategory;
00092 
00093         Component(wns::node::Interface*, const wns::pyconfig::View&);
00094 
00095         std::string
00096         getName() const;
00097 
00102         unsigned int getCellID() const;
00103 
00107         unsigned int getID() const
00108         {
00109             return id_;
00110         }
00111 
00112 
00127         unsigned int getRing() const;
00128 
00130         wns::service::dll::UnicastAddress getDLLAddress() const
00131         {
00132             return address_;
00133         }
00134 
00138         wns::ldk::fun::Main*
00139         getFUN();
00140 
00146         int getNumberOfQueuedPDUs(ConnectionIdentifiers cis);
00147 
00148         // ComponentInterface
00149         virtual void onNodeCreated();
00150         virtual void onWorldCreated();
00151         virtual void onShutdown();
00152 
00161         int getStationType() const
00162         {
00163             return stationType_;
00164         }
00165 
00169         void doVisit(wns::probe::bus::IContext&) const;
00170 
00171 
00175         wns::service::dll::UnicastAddress
00176         getMACAddress() const
00177         {
00178             return address_;
00179         }
00180 
00181     private:
00182         Component(const Component&); // disallow copy constructor
00183         Component& operator=(const Component&); // disallow assignment
00184 
00185         virtual void
00186         doStartup();
00187 
00188 
00189         wns::ldk::fun::Main* fun_;
00190 
00191         //Values form PyConfig
00192         int stationType_;
00193         unsigned int id_;
00194         wns::service::dll::UnicastAddress address_;
00195         unsigned int ring_;
00196 
00197         wns::probe::bus::ContextProviderCollection contextProviders_;
00198     };
00199 }
00200 
00201 #endif

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