00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/bitstream/Spartan6Bitstream.hpp $ 00003 // $Id: Spartan6Bitstream.hpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Header for the Spartan6Bitstream class. 00018 00019 #ifndef TORC_BITSTREAM_SPARTAN6BITSTREAM_HPP 00020 #define TORC_BITSTREAM_SPARTAN6BITSTREAM_HPP 00021 00022 #include <boost/cstdint.hpp> 00023 #include "torc/bitstream/Bitstream.hpp" 00024 #include "torc/bitstream/Spartan6Packet.hpp" 00025 00026 namespace torc { 00027 namespace bitstream { 00028 00029 namespace bitstream { class Spartan6BitstreamUnitTest; } 00030 00031 /// \brief Spartan-class bitstream. 00032 class Spartan6Bitstream : public Bitstream, public Spartan6PacketVector, 00033 public Spartan6PacketConstants { 00034 friend class torc::bitstream::bitstream::Spartan6BitstreamUnitTest; 00035 protected: 00036 // typedefs 00037 /// \brief Imported type name. 00038 typedef boost::uint16_t uint16_t; 00039 typedef boost::uint32_t uint32_t; 00040 // members 00041 public: 00042 // constructors 00043 /// \brief Basic constructor. 00044 Spartan6Bitstream(void) : Bitstream(), Spartan6PacketVector(), Spartan6PacketConstants() {} 00045 // functions 00046 /// \brief Read bitstream packets from a stream. 00047 /// \note This function should be called after the bitstream header has been read. 00048 virtual void readPackets(std::istream& inStream); 00049 /// \brief Write bitstream packets to a stream. 00050 virtual void writePackets(std::ostream& inStream); 00051 /// \brief Preflight the packets. 00052 virtual void preflightPackets(void); 00053 /// \brief Update the header packet length. 00054 virtual void updatePacketLength(void); 00055 }; 00056 00057 } // namespace bitstream 00058 } // namespace torc 00059 00060 #endif // TORC_BITSTREAM_SPARTAN6BITSTREAM_HPP