User Manual, Developers Guide and API Documentation

PCI.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. 16, 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 WNS_PCI_HPP
00029 #define WNS_PCI_HPP
00030 
00031 
00032 #include <WNS/osi/PDU.hpp>
00033 
00034 #include <WNS/RefCountable.hpp>
00035 #include <WNS/IOutputStreamable.hpp>
00036 #include <WNS/SmartPtr.hpp>
00037 
00038 #include <WNS/simulator/Bit.hpp>
00039 #include <iostream>
00040 
00041 namespace wns { namespace osi {
00042 
00044 class PCI :
00045     virtual public wns::RefCountable,
00046     public wns::IOutputStreamable
00047 {
00048     friend class PDU;
00049 
00050 public:
00051 
00052     //# Public types and constants
00053 
00055     static const pduType unknown = 0;
00056 
00057 
00058     //# Constructors and destructor
00059     // Default constructor
00060     PCI(pduType aPDUType = unknown, const unsigned long int aPDULength = 0);
00061 
00062     // Default copy constructor is correct
00063     // Destructor
00064     virtual ~PCI();
00065 
00066     // Normal output
00067     virtual void print(std::ostream& aStreamRef = std::cout) const;
00068 
00069     //# Public members
00070     PCI(const PCI &that);
00071 
00072     // Set type of PDU
00073     void setPDUType(pduType aPDUType);
00074     // Get type of PDU
00075     pduType getPDUType() const;
00076 
00077     // Get unique identifier
00078     unsigned long int getPDUId() const;
00079 
00088     virtual void setPDULength(Bit aPDULength);
00089 
00097     virtual Bit getPDULength() const;
00098 
00104     virtual Bit getSize() const;
00105 
00121     virtual Bit getSDUSize() const;
00122 
00127     virtual PDUPtr getSDU() const;
00128 
00129 #ifndef NDEBUG
00130     virtual size_t
00131     calcObjSize() const
00132     {
00133         return sizeof(*this);
00134     }
00135 #endif
00136 
00137 protected:
00142     virtual void 
00143     setSDU(PDUPtr& sdu);
00144 
00145 private:
00146 
00147     virtual std::string
00148     doToString() const;
00149 
00150     //# Internal private members
00151 
00153     pduType p_pdu;
00154 
00156     unsigned long int p_pduId;
00157 
00158     /* Id counter, which is incremented whenever the default or the
00159       param constructor is used. */
00160     static unsigned long int p_pduIdCounter;
00161 
00163     Bit p_pduLength;
00164 
00166     PDUPtr p_sduPtr;
00167 };
00168 
00169 } // wns
00170 } // osi
00171 
00172 #endif  // WNS_PCI_HPP
00173 
00174 /*
00175 Local Variables:
00176 mode: c++
00177 folded-file: t
00178 End:
00179 */
00180 
00181 

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