torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bitstream/OutputStreamHelpers.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Header for torc::bitstream output stream helpers.
18 
19 #ifndef TORC_BITSTREAM_OUTPUTSTREAMHELPERS_HPP
20 #define TORC_BITSTREAM_OUTPUTSTREAMHELPERS_HPP
21 
22 #include <boost/cstdint.hpp>
23 #include <iosfwd>
24 
25 namespace torc {
26 namespace bitstream {
27 
28  class Bitstream;
29  class Spartan6Bitstream;
30 
31  class Spartan3E;
32  class Spartan6;
33 
34  class Virtex;
35  class Virtex2;
36  class Virtex4;
37  class Virtex5;
38  class Virtex6;
39  class Virtex7;
40 
41  /// \brief Spartan6Bitstream stream inserter.
42  std::ostream& operator <<(std::ostream& os, const Spartan6Bitstream& rhs);
43  /// \brief Bitstream stream inserter.
44  std::ostream& operator <<(std::ostream& os, const Bitstream& rhs);
45  /// \brief Spartan3E stream inserter.
46  std::ostream& operator <<(std::ostream& os, const Spartan3E& rhs);
47  /// \brief Spartan6 stream inserter.
48  std::ostream& operator <<(std::ostream& os, const Spartan6& rhs);
49  /// \brief Virtex stream inserter.
50  std::ostream& operator <<(std::ostream& os, const Virtex& rhs);
51  /// \brief Virtex2 stream inserter.
52  std::ostream& operator <<(std::ostream& os, const Virtex2& rhs);
53  /// \brief Virtex4 stream inserter.
54  std::ostream& operator <<(std::ostream& os, const Virtex4& rhs);
55  /// \brief Virtex5 stream inserter.
56  std::ostream& operator <<(std::ostream& os, const Virtex5& rhs);
57  /// \brief Virtex6 stream inserter.
58  std::ostream& operator <<(std::ostream& os, const Virtex6& rhs);
59  /// \brief Virtex7 stream inserter.
60  std::ostream& operator <<(std::ostream& os, const Virtex7& rhs);
61 
62  class Hex16 {
63  boost::uint16_t mWord;
64  public:
65  Hex16(boost::uint16_t rhs) : mWord(rhs) {};
66  friend std::ostream& operator <<(std::ostream& os, const Hex16& rhs);
67  };
68 
69  class Hex32 {
70  boost::uint32_t mWord;
71  public:
72  Hex32(boost::uint32_t rhs) : mWord(rhs) {};
73  friend std::ostream& operator <<(std::ostream& os, const Hex32& rhs);
74  };
75 
76  /// \brief 16-bit word hex inserter.
77  std::ostream& operator <<(std::ostream& os, const Hex16& rhs);
78 
79  /// \brief 32-bit word hex inserter.
80  std::ostream& operator <<(std::ostream& os, const Hex32& rhs);
81 
82 } // namespace bitstream
83 } // namespace torc
84 
85 #endif // TORC_BITSTREAM_OUTPUTSTREAMHELPERS_HPP
std::ostream & operator<<(std::ostream &os, const Hex16 &inWord)
16-bit word hex inserter.
friend std::ostream & operator<<(std::ostream &os, const Hex32 &rhs)
32-bit word hex inserter.
friend std::ostream & operator<<(std::ostream &os, const Hex16 &rhs)
16-bit word hex inserter.