User Manual, Developers Guide and API Documentation

PDU.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-2007
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 APPLICATIONS_SESSION_PDU_HPP
00029 #define APPLICATIONS_SESSION_PDU_HPP
00030 
00031 #include <WNS/SmartPtr.hpp>
00032 #include <WNS/osi/PDU.hpp>
00033 #include <WNS/osi/PCI.hpp>
00034 #include <WNS/simulator/Time.hpp>
00035 #include <WNS/pyconfig/View.hpp>
00036 
00037 namespace applications { namespace session {
00038 
00039 class Session;
00040 
00041     class PDU :
00042     public wns::osi::PDU
00043     {
00044     public:
00045       PDU(Bit packetSize, const wns::pyconfig::View& _pyco);
00046       virtual ~PDU();
00047 
00048       /* used to chek if this is the last packet */
00049       virtual void
00050       setLastPacket(bool _lastPacket);
00051 
00052       virtual bool
00053       getLastPacket();
00054 
00055       /* used to calculate the packet delay */
00056       virtual void
00057       setCreationTime(wns::simulator::Time _creationTime);
00058 
00059       virtual wns::simulator::Time
00060       getCreationTime();
00061 
00062       /* used to calculate the packet size */
00063       virtual void
00064       setFileLength(Bit _length);
00065 
00066       virtual Bit
00067       getFileLength();
00068 
00069       /* used to chek if this packet is a request or data packet */
00070       virtual void
00071       setRequest(bool _request);
00072 
00073       virtual bool
00074       getRequest();
00075 
00076       /* used to tell the server which movie the client wants */
00077       virtual void
00078       setMovieChoice(const char* _movieChoice);
00079 
00080       virtual const char*
00081       getMovieChoice();
00082 
00083       virtual void
00084       setPacketNumber(int _packetNumber, std::string _packetFrom);
00085 
00086       virtual int
00087       getPacketNumber();
00088 
00089       virtual std::string
00090       getPacketFrom();
00091 
00092       void
00093       setSender(applications::session::Session* sender);
00094 
00095       applications::session::Session*
00096       getSender();
00097 
00098     private:
00104       virtual Bit
00105       doGetLengthInBits() const;
00106 
00107       bool lastPacket;
00108       bool request;
00109       Bit fileLength;
00110       const char* movieChoice;
00111       wns::simulator::Time creationTime;
00112       //     wns::logger::Logger logger;
00113       //      wns::pyconfig::View pyco;
00114 
00115       // TEST
00116       int packetNumber;
00117       std::string packetFrom;
00118 
00119       applications::session::Session* sender;
00120     };
00121 
00127     typedef wns::SmartPtr<PDU> PDUPtr;
00128 
00129   } //namespace session
00130 } //namespace applications
00131 #endif // APPLICATIONS_SESSION_PDU_HPP

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