User Manual, Developers Guide and API Documentation

Transmitter.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  * 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 
00028 #ifndef COPPER_TRANSMITTER_HPP
00029 #define COPPER_TRANSMITTER_HPP
00030 
00031 #include <WNS/service/phy/copper/DataTransmissionFeedback.hpp>
00032 #include <WNS/service/phy/copper/DataTransmission.hpp>
00033 #include <WNS/service/phy/copper/Handler.hpp>
00034 #include <WNS/logger/Logger.hpp>
00035 
00036 namespace copper
00037 {
00038     class WireInterface;
00039 
00040     class TransmitterDataSentInterface
00041     {
00042     public:
00043         virtual
00044         ~TransmitterDataSentInterface()
00045         {
00046         }
00047 
00048         virtual void
00049         onDataSent(
00050             wns::osi::PDUPtr pdu) = 0;
00051     };
00052 
00061     class Transmitter :
00062         virtual public wns::service::phy::copper::DataTransmission,
00063         virtual public wns::service::phy::copper::DataTransmissionFeedback,
00064         virtual public TransmitterDataSentInterface
00065     {
00066         typedef wns::service::phy::copper::DataTransmission
00067         Super;
00068 
00069         typedef wns::service::phy::copper::Handler
00070         Handler;
00071     public:
00075         Transmitter(
00076             const wns::pyconfig::View& pyco,
00077             WireInterface* wire);
00078 
00082         virtual
00083         ~Transmitter(
00084             );
00085 
00090         virtual void
00091         sendData(
00092             const wns::service::dll::BroadcastAddress& /*peerAddress*/,
00093             const wns::osi::PDUPtr& data);
00094 
00095         virtual void
00096         sendData(
00097             const wns::service::dll::UnicastAddress& peerAddress,
00098             const wns::osi::PDUPtr& data);
00099 
00100         virtual void
00101         cancelData(
00102             const wns::osi::PDUPtr& data);
00103 
00104         virtual bool
00105         isFree(
00106             ) const;
00108 
00109         virtual void
00110         onDataSent(
00111             wns::osi::PDUPtr pdu);
00112 
00113     private:
00117         simTimeType
00118         getDuration(
00119             Bit len);
00120 
00124         WireInterface* wire;
00125 
00129         double dataRate;
00130 
00135         simTimeType sensingTime;
00136 
00140         wns::logger::Logger logger;
00141     };
00142 }
00143 
00144 #endif // NOT defined COPPER_TRANSMITTER_HPP
00145 
00146 

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