![]() |
User Manual, Developers Guide and API Documentation |
![]() |
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 #include <APPLICATIONS/session/PDU.hpp> 00029 #include <APPLICATIONS/session/Session.hpp> 00030 00031 using namespace applications::session; 00032 00033 PDU::PDU(Bit _packetSize, const wns::pyconfig::View& _pyco): 00034 wns::osi::PDU(new wns::osi::PCI), 00035 lastPacket(false), 00036 creationTime(0.0), 00037 fileLength(0.0), 00038 request(false), 00039 movieChoice(""), 00040 packetNumber(0), 00041 sender(NULL) 00042 { 00043 getPCI()->setPDULength(_packetSize); 00044 } 00045 00046 PDU::~PDU() 00047 { 00048 } 00049 00050 Bit 00051 PDU::doGetLengthInBits() const 00052 { 00053 return getPCI()->getPDULength(); 00054 } 00055 00056 void 00057 PDU::setLastPacket(bool _lastPacket) 00058 { 00059 lastPacket = _lastPacket; 00060 } 00061 00062 bool 00063 PDU::getLastPacket() 00064 { 00065 return lastPacket; 00066 } 00067 00068 applications::session::Session* 00069 PDU::getSender() 00070 { 00071 return sender; 00072 } 00073 00074 void 00075 PDU::setSender(applications::session::Session* s) 00076 { 00077 sender = s; 00078 } 00079 00080 void 00081 PDU::setCreationTime(wns::simulator::Time _creationTime) 00082 { 00083 creationTime = _creationTime; 00084 } 00085 00086 wns::simulator::Time 00087 PDU::getCreationTime() 00088 { 00089 return creationTime; 00090 } 00091 00092 void 00093 PDU::setFileLength(Bit _length) 00094 { 00095 fileLength = _length; 00096 } 00097 00098 Bit 00099 PDU::getFileLength() 00100 { 00101 return fileLength; 00102 } 00103 00104 void 00105 PDU::setRequest(bool _request) 00106 { 00107 request = _request; 00108 } 00109 00110 bool 00111 PDU::getRequest() 00112 { 00113 return request; 00114 } 00115 00116 void 00117 PDU::setMovieChoice(const char* _movieChoice) 00118 { 00119 movieChoice = _movieChoice; 00120 } 00121 00122 const char* 00123 PDU::getMovieChoice() 00124 { 00125 return movieChoice; 00126 } 00127 00128 void 00129 PDU::setPacketNumber(int _packetNumber, std::string _packetFrom) 00130 { 00131 packetNumber = _packetNumber; 00132 packetFrom = _packetFrom; 00133 } 00134 00135 int 00136 PDU::getPacketNumber() 00137 { 00138 return packetNumber; 00139 } 00140 00141 std::string 00142 PDU::getPacketFrom() 00143 { 00144 return packetFrom; 00145 }
1.5.5